Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CGoGN
CGoGN
Commits
1c7c7d22
Commit
1c7c7d22
authored
Jun 05, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Container to compile testing
parent
bdbe88ff
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
305 additions
and
84 deletions
+305
-84
Apps/Tests/Algo/LinearSolving/basic.cpp
Apps/Tests/Algo/LinearSolving/basic.cpp
+2
-3
Apps/Tests/CMakeLists.txt
Apps/Tests/CMakeLists.txt
+1
-0
Apps/Tests/Container/CMakeLists.txt
Apps/Tests/Container/CMakeLists.txt
+12
-0
Apps/Tests/Container/attributeContainer.cpp
Apps/Tests/Container/attributeContainer.cpp
+68
-0
Apps/Tests/Container/attributeMultiVector.cpp
Apps/Tests/Container/attributeMultiVector.cpp
+24
-0
Apps/Tests/Container/containerBrowser.cpp
Apps/Tests/Container/containerBrowser.cpp
+34
-0
Apps/Tests/Container/test_container.cpp
Apps/Tests/Container/test_container.cpp
+17
-0
Apps/Tests/Geometry/vector_gen.cpp
Apps/Tests/Geometry/vector_gen.cpp
+17
-2
Apps/Tests/Utils/CMakeLists.txt
Apps/Tests/Utils/CMakeLists.txt
+2
-1
Apps/Tests/Utils/textures.cpp
Apps/Tests/Utils/textures.cpp
+43
-1
CGoGN/include/Algo/Modelisation/subdivision.hpp
CGoGN/include/Algo/Modelisation/subdivision.hpp
+1
-1
CGoGN/include/Container/attributeContainer.hpp
CGoGN/include/Container/attributeContainer.hpp
+2
-2
CGoGN/include/Geometry/vector_gen.hpp
CGoGN/include/Geometry/vector_gen.hpp
+4
-3
CGoGN/include/Utils/qem.hpp
CGoGN/include/Utils/qem.hpp
+9
-9
CGoGN/include/Utils/quadricRGBfunctions.hpp
CGoGN/include/Utils/quadricRGBfunctions.hpp
+47
-47
CGoGN/include/Utils/quantization.hpp
CGoGN/include/Utils/quantization.hpp
+10
-6
CGoGN/include/Utils/sphericalHarmonics.hpp
CGoGN/include/Utils/sphericalHarmonics.hpp
+6
-6
CGoGN/include/Utils/static_assert.h
CGoGN/include/Utils/static_assert.h
+6
-3
No files found.
Apps/Tests/Algo/LinearSolving/basic.cpp
View file @
1c7c7d22
...
...
@@ -9,9 +9,8 @@
using
namespace
CGoGN
;
template
class
Algo
::
LinearSolving
::
Coeff
<
float
>;
template
class
Algo
::
LinearSolving
::
Coeff
<
double
>;
// Vec3 ?
template
struct
Algo
::
LinearSolving
::
Coeff
<
float
>;
template
struct
Algo
::
LinearSolving
::
Coeff
<
double
>;
struct
PFP1
:
public
PFP_DOUBLE
...
...
Apps/Tests/CMakeLists.txt
View file @
1c7c7d22
...
...
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.6)
project
(
testing
)
add_subdirectory
(
Algo
)
add_subdirectory
(
Container
)
add_subdirectory
(
Geometry
)
add_subdirectory
(
Utils
)
...
...
Apps/Tests/Container/CMakeLists.txt
0 → 100644
View file @
1c7c7d22
cmake_minimum_required
(
VERSION 2.6
)
project
(
testing_container
)
add_executable
(
test_container
test_container.cpp
attributeContainer.cpp
attributeMultiVector.cpp
containerBrowser.cpp
)
target_link_libraries
(
test_container
${
CGoGN_LIBS
}
${
CGoGN_EXT_LIBS
}
)
Apps/Tests/Container/attributeContainer.cpp
0 → 100644
View file @
1c7c7d22
#include "Container/attributeContainer.h"
#include "Geometry/vector_gen.h"
using
namespace
CGoGN
;
// char instantiation
template
AttributeMultiVector
<
char
>
*
AttributeContainer
::
addAttribute
<
char
>
(
const
std
::
string
&
attribName
);
template
void
AttributeContainer
::
addAttribute
<
char
>(
const
std
::
string
&
attribName
,
const
std
::
string
&
typeName
,
unsigned
int
index
);
template
bool
AttributeContainer
::
removeAttribute
<
char
>(
const
std
::
string
&
attribName
);
template
bool
AttributeContainer
::
removeAttribute
<
char
>(
unsigned
int
index
);
template
unsigned
int
AttributeContainer
::
getAttributeBlocksPointers
<
char
>(
unsigned
int
attrIndex
,
std
::
vector
<
char
*>&
vect_ptr
,
unsigned
int
&
byteBlockSize
)
const
;
template
AttributeMultiVector
<
char
>
*
AttributeContainer
::
getDataVector
<
char
>
(
unsigned
int
attrIndex
);
template
AttributeMultiVector
<
char
>
*
AttributeContainer
::
getDataVector
<
char
>
(
const
std
::
string
&
attribName
);
template
char
&
AttributeContainer
::
getData
<
char
>(
unsigned
int
attrIndex
,
unsigned
int
eltIndex
)
;
template
const
char
&
AttributeContainer
::
getData
<
char
>(
unsigned
int
attrIndex
,
unsigned
int
eltIndex
)
const
;
template
void
AttributeContainer
::
setData
<
char
>(
unsigned
int
attrIndex
,
unsigned
int
eltIndex
,
const
char
&
data
);
// int instantiation
//
//template AttributeMultiVector<int>* AttributeContainer::addAttribute<int>(const std::string& attribName);
//template void AttributeContainer::addAttribute<int>(const std::string& attribName, const std::string& typeName, unsigned int index);
//template bool AttributeContainer::removeAttribute<int>(const std::string& attribName);
//template bool AttributeContainer::removeAttribute<int>(unsigned int index);
//template unsigned int AttributeContainer::getAttributeBlocksPointers<int>(unsigned int attrIndex, std::vector<int*>& vect_ptr, unsigned int& byteBlockSize) const;
//template AttributeMultiVector<int>* AttributeContainer::getDataVector<int>(unsigned int attrIndex);
//template AttributeMultiVector<int>* AttributeContainer::getDataVector<int>(const std::string& attribName);
//template int& AttributeContainer::getData<int>(unsigned int attrIndex, unsigned int eltIndex);
//template const int& AttributeContainer::getData<int>(unsigned int attrIndex, unsigned int eltIndex) const;
//template void AttributeContainer::setData<int>(unsigned int attrIndex, unsigned int eltIndex, const int& data);
//
//
//// double instantiation
//
//template AttributeMultiVector<double>* AttributeContainer::addAttribute<double>(const std::string& attribName);
//template void AttributeContainer::addAttribute<double>(const std::string& attribName, const std::string& typeName, unsigned int index);
//template bool AttributeContainer::removeAttribute<double>(const std::string& attribName);
//template bool AttributeContainer::removeAttribute<double>(unsigned int index);
//template unsigned int AttributeContainer::getAttributeBlocksPointers<double>(unsigned int attrIndex, std::vector<double*>& vect_ptr, unsigned int& byteBlockSize) const;
//template AttributeMultiVector<double>* AttributeContainer::getDataVector<double>(unsigned int attrIndex);
//template AttributeMultiVector<double>* AttributeContainer::getDataVector<double>(const std::string& attribName);
//template double& AttributeContainer::getData<double>(unsigned int attrIndex, unsigned int eltIndex);
//template const double& AttributeContainer::getData<double>(unsigned int attrIndex, unsigned int eltIndex) const;
//template void AttributeContainer::setData<double>(unsigned int attrIndex, unsigned int eltIndex, const double& data);
//
//
//// Geom::Vec4f instantiation
//
//template AttributeMultiVector<Geom::Vec4f>* AttributeContainer::addAttribute<Geom::Vec4f>(const std::string& attribName);
//template void AttributeContainer::addAttribute<Geom::Vec4f>(const std::string& attribName, const std::string& typeName, unsigned int index);
//template bool AttributeContainer::removeAttribute<Geom::Vec4f>(const std::string& attribName);
//template bool AttributeContainer::removeAttribute<Geom::Vec4f>(unsigned int index);
//template unsigned int AttributeContainer::getAttributeBlocksPointers<Geom::Vec4f>(unsigned int attrIndex, std::vector<Geom::Vec4f*>& vect_ptr, unsigned int& byteBlockSize) const;
//template AttributeMultiVector<Geom::Vec4f>* AttributeContainer::getDataVector<Geom::Vec4f>(unsigned int attrIndex);
//template AttributeMultiVector<Geom::Vec4f>* AttributeContainer::getDataVector<Geom::Vec4f>(const std::string& attribName);
//template Geom::Vec4f& AttributeContainer::getData<Geom::Vec4f>(unsigned int attrIndex, unsigned int eltIndex);
//template const Geom::Vec4f& AttributeContainer::getData<Geom::Vec4f>(unsigned int attrIndex, unsigned int eltIndex) const;
//template void AttributeContainer::setData<Geom::Vec4f>(unsigned int attrIndex, unsigned int eltIndex, const Geom::Vec4f& data);
int
test_attributeContainer
()
{
return
0
;
}
\ No newline at end of file
Apps/Tests/Container/attributeMultiVector.cpp
0 → 100644
View file @
1c7c7d22
#include "Container/attributeMultiVector.h"
#include "Geometry/vector_gen.h"
#include "Container/fakeAttribute.h"
using
namespace
CGoGN
;
template
class
AttributeMultiVector
<
char
>;
template
class
AttributeMultiVector
<
unsigned
char
>;
template
class
AttributeMultiVector
<
int
>;
template
class
AttributeMultiVector
<
unsigned
int
>;
template
class
AttributeMultiVector
<
long
int
>;
template
class
AttributeMultiVector
<
unsigned
long
int
>;
template
class
AttributeMultiVector
<
float
>;
template
class
AttributeMultiVector
<
double
>;
template
class
AttributeMultiVector
<
Geom
::
Vec3f
>;
template
class
AttributeMultiVector
<
NoTypeNameAttribute
<
std
::
vector
<
Geom
::
Vec2i
>
::
const_iterator
>
>
;
int
test_attributeMultiVector
()
{
return
0
;
}
Apps/Tests/Container/containerBrowser.cpp
0 → 100644
View file @
1c7c7d22
#include "Topology/map/embeddedMap2.h"
#include "Topology/map/embeddedMap3.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Container/containerBrowser.h"
using
namespace
CGoGN
;
template
class
DartContainerBrowserSelector
<
EmbeddedMap2
>;
template
class
DartContainerBrowserSelector
<
EmbeddedMap3
>;
template
class
DartContainerBrowserSelector
<
EmbeddedGMap2
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedMap2
,
VERTEX
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedMap2
,
EDGE
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedMap2
,
FACE
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedGMap2
,
VERTEX
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedGMap2
,
EDGE
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedGMap2
,
FACE
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedMap3
,
VERTEX
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedMap3
,
EDGE
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedMap3
,
FACE
>;
template
class
ContainerBrowserCellMarked
<
EmbeddedMap3
,
VOLUME
>;
int
test_containerBrowser
()
{
return
0
;
}
\ No newline at end of file
Apps/Tests/Container/test_container.cpp
0 → 100644
View file @
1c7c7d22
#include <iostream>
// no header files test function names from cpp files
extern
int
test_attributeContainer
();
extern
int
test_attributeMultiVector
();
extern
int
test_containerBrowser
();
int
main
()
{
test_attributeContainer
();
test_attributeMultiVector
();
test_containerBrowser
();
return
0
;
}
Apps/Tests/Geometry/vector_gen.cpp
View file @
1c7c7d22
#include <iostream>
#include <Geometry/matrix.h>
#define CGOGN_NO_STATIC_ASSERT 1
#include "Geometry/vector_gen.h"
using
namespace
CGoGN
;
// template instantiation not possible (static assert pb);
template
class
Geom
::
Vector
<
2
,
short
>;
template
class
Geom
::
Vector
<
2
,
float
>;
template
class
Geom
::
Vector
<
2
,
double
>;
template
class
Geom
::
Vector
<
3
,
short
>;
template
class
Geom
::
Vector
<
3
,
float
>;
template
class
Geom
::
Vector
<
3
,
double
>;
template
class
Geom
::
Vector
<
4
,
short
>;
template
class
Geom
::
Vector
<
4
,
float
>;
template
class
Geom
::
Vector
<
4
,
double
>;
template
class
Geom
::
Vector
<
11
,
short
>;
template
class
Geom
::
Vector
<
11
,
float
>;
template
class
Geom
::
Vector
<
11
,
double
>;
int
test_vector
()
{
...
...
Apps/Tests/Utils/CMakeLists.txt
View file @
1c7c7d22
cmake_minimum_required
(
VERSION 2.6
)
project
(
testing_utils
)
add_executable
(
test_utils
test_utils.cpp
colorMaps.cpp
...
...
@@ -17,3 +17,4 @@ target_link_libraries( test_utils
${
CGoGN_LIBS
}
${
CGoGN_EXT_LIBS
}
)
qt_use_cgogn_modules
(
test_utils
)
Apps/Tests/Utils/textures.cpp
View file @
1c7c7d22
#
include "Utils/textures.h"
#
define CGOGN_NO_STATIC_ASSERT 1
#include "Utils/textures.h"
template
class
CGoGN
::
Utils
::
Filter
<
1
>;
template
class
CGoGN
::
Utils
::
Filter
<
2
>;
template
class
CGoGN
::
Utils
::
Filter
<
3
>;
///////////////// 1 ////////////////////////////////
template
class
CGoGN
::
Utils
::
ImageData
<
1
,
unsigned
char
>;
template
class
CGoGN
::
Utils
::
Image
<
1
,
unsigned
char
>;
template
class
CGoGN
::
Utils
::
Texture
<
1
,
unsigned
char
>;
template
class
CGoGN
::
Utils
::
ImageData
<
1
,
int
>;
template
class
CGoGN
::
Utils
::
Image
<
1
,
int
>;
template
class
CGoGN
::
Utils
::
Texture
<
1
,
int
>;
template
class
CGoGN
::
Utils
::
ImageData
<
1
,
double
>;
template
class
CGoGN
::
Utils
::
Image
<
1
,
double
>;
template
class
CGoGN
::
Utils
::
Texture
<
1
,
double
>;
template
class
CGoGN
::
Utils
::
ImageData
<
1
,
CGoGN
::
Geom
::
Vec4f
>;
template
class
CGoGN
::
Utils
::
Image
<
1
,
CGoGN
::
Geom
::
Vec4f
>;
template
class
CGoGN
::
Utils
::
Texture
<
1
,
CGoGN
::
Geom
::
Vec4f
>;
///////////////// 2 //////////////////////////////////////
template
class
CGoGN
::
Utils
::
ImageData
<
2
,
unsigned
char
>;
template
class
CGoGN
::
Utils
::
Image
<
2
,
unsigned
char
>;
...
...
@@ -17,6 +38,27 @@ template class CGoGN::Utils::ImageData<2, double>;
template
class
CGoGN
::
Utils
::
Image
<
2
,
double
>;
template
class
CGoGN
::
Utils
::
Texture
<
2
,
double
>;
template
class
CGoGN
::
Utils
::
ImageData
<
2
,
CGoGN
::
Geom
::
Vec4f
>;
template
class
CGoGN
::
Utils
::
Image
<
2
,
CGoGN
::
Geom
::
Vec4f
>;
template
class
CGoGN
::
Utils
::
Texture
<
2
,
CGoGN
::
Geom
::
Vec4f
>;
////////////////// 3 /////////////////////////////////////
template
class
CGoGN
::
Utils
::
ImageData
<
3
,
unsigned
char
>;
template
class
CGoGN
::
Utils
::
Image
<
3
,
unsigned
char
>;
template
class
CGoGN
::
Utils
::
Texture
<
3
,
unsigned
char
>;
template
class
CGoGN
::
Utils
::
ImageData
<
3
,
int
>;
template
class
CGoGN
::
Utils
::
Image
<
3
,
int
>;
template
class
CGoGN
::
Utils
::
Texture
<
3
,
int
>;
template
class
CGoGN
::
Utils
::
ImageData
<
3
,
double
>;
template
class
CGoGN
::
Utils
::
Image
<
3
,
double
>;
template
class
CGoGN
::
Utils
::
Texture
<
3
,
double
>;
template
class
CGoGN
::
Utils
::
ImageData
<
3
,
CGoGN
::
Geom
::
Vec4f
>;
template
class
CGoGN
::
Utils
::
Image
<
3
,
CGoGN
::
Geom
::
Vec4f
>;
template
class
CGoGN
::
Utils
::
Texture
<
3
,
CGoGN
::
Geom
::
Vec4f
>;
int
test_texture
()
{
...
...
CGoGN/include/Algo/Modelisation/subdivision.hpp
View file @
1c7c7d22
...
...
@@ -709,7 +709,7 @@ void LoopSubdivision(typename PFP::MAP& map, EMBV& attributs)
{
double
beta
=
betaF
(
n
)
;
temp
*=
(
beta
/
double
(
n
));
emcp
*=
(
1.0
-
beta
);
emcp
*=
(
1.0
f
-
beta
);
emcp
+=
temp
;
}
attributs
[
*
vert
]
=
emcp
;
...
...
CGoGN/include/Container/attributeContainer.hpp
View file @
1c7c7d22
...
...
@@ -142,7 +142,7 @@ void AttributeContainer::addAttribute(const std::string& attribName, const std::
m_lineCost
+=
sizeof
(
T
)
;
// resize the new attribute so that it has the same size than others
amv
->
setNbBlocks
(
m_holesBlocks
.
size
())
;
amv
->
setNbBlocks
(
uint32
(
m_holesBlocks
.
size
())
)
;
m_nbAttributes
++
;
}
...
...
@@ -205,7 +205,7 @@ unsigned int AttributeContainer::getAttributeBlocksPointers(unsigned int attrInd
AttributeMultiVector
<
T
>*
atm
=
dynamic_cast
<
AttributeMultiVector
<
T
>*>
(
m_tableAttribs
[
attrIndex
]);
assert
((
atm
!=
NULL
)
||
!
"getAttributeBlocksPointers: wrong type"
);
return
atm
->
getBlocksPointers
(
vect_ptr
,
byteBlockSize
);
return
atm
->
getBlocksPointers
(
reinterpret_cast
<
std
::
vector
<
void
*>&>
(
vect_ptr
)
,
byteBlockSize
);
}
/**************************************
...
...
CGoGN/include/Geometry/vector_gen.hpp
View file @
1c7c7d22
...
...
@@ -24,6 +24,7 @@
#include <sstream>
#include <cmath>
#include <cstdlib>
namespace
CGoGN
{
...
...
@@ -374,7 +375,7 @@ inline bool Vector<DIM, T>::isNormalized(const T& epsilon) const
template
<
unsigned
int
DIM
,
typename
T
>
inline
bool
Vector
<
DIM
,
T
>::
isOrthogonal
(
const
Vector
<
DIM
,
T
>&
v
,
const
T
&
epsilon
)
const
{
return
(
f
abs
(
v
*
(
*
this
))
<
epsilon
)
;
return
(
std
::
abs
(
v
*
(
*
this
))
<
epsilon
)
;
}
template
<
unsigned
int
DIM
,
typename
T
>
...
...
@@ -424,9 +425,9 @@ inline bool isNull(T x, int precision)
if
(
precision
==
0
)
return
(
x
==
0
)
;
else
if
(
precision
>
0
)
return
(
f
abs
(
x
)
<
precision
)
;
return
(
std
::
abs
(
x
)
<
precision
)
;
else
return
(
precision
*
f
abs
(
x
)
<
1
)
;
return
(
precision
*
std
::
abs
(
x
)
<
1
)
;
}
/***
...
...
CGoGN/include/Utils/qem.hpp
View file @
1c7c7d22
...
...
@@ -501,7 +501,7 @@ QuadricHF<REAL>::findOptimizedCoefs(std::vector<VEC3>& coefs)
Eigen
::
VectorXd
tmp
(
m_b
[
0
].
size
())
;
tmp
=
Ainv
*
m_b
[
c
]
;
for
(
unsigned
int
i
=
0
;
i
<
m_b
[
c
].
size
()
;
++
i
)
coefs
[
i
][
c
]
=
tmp
[
i
]
;
coefs
[
i
][
c
]
=
REAL
(
tmp
[
i
]
)
;
}
return
true
;
...
...
@@ -522,9 +522,9 @@ QuadricHF<REAL>::evaluate(const std::vector<VEC3>& coefs) const
res
[
c
]
+=
m_c
[
c
]
;
// + c
}
res
/=
2
*
M_PI
;
// max integral value over hemisphere
res
/=
REAL
(
2
*
M_PI
)
;
// max integral value over hemisphere
return
(
res
[
0
]
+
res
[
1
]
+
res
[
2
])
/
3.
;
return
(
res
[
0
]
+
res
[
1
]
+
res
[
2
])
/
3.
0
f
;
}
template
<
typename
REAL
>
...
...
@@ -537,9 +537,9 @@ QuadricHF<REAL>::evalR3(const std::vector<VEC3>& coefs) const
Eigen
::
VectorXd
tmp
(
coefs
.
size
())
;
for
(
unsigned
int
i
=
0
;
i
<
coefs
.
size
()
;
++
i
)
tmp
[
i
]
=
coefs
[
i
][
c
]
;
res
[
c
]
=
tmp
.
transpose
()
*
m_A
*
tmp
;
// A
res
[
c
]
-=
2.0
f
*
(
m_b
[
c
]).
transpose
()
*
tmp
;
// - 2b
res
[
c
]
+=
m_c
[
c
]
;
// + c
res
[
c
]
=
REAL
(
tmp
.
transpose
()
*
m_A
*
tmp
)
;
// A
res
[
c
]
-=
REAL
(
2.0
f
*
(
m_b
[
c
]).
transpose
()
*
tmp
)
;
// - 2b
res
[
c
]
+=
REAL
(
m_c
[
c
]
)
;
// + c
}
res
/=
2
*
M_PI
;
// max integral value over hemisphere
...
...
@@ -573,7 +573,7 @@ QuadricHF<REAL>::rotate(const Geom::Tensor3d& T, const Geom::Matrix33d& R)
std
::
vector
<
unsigned
int
>
q
;
q
.
resize
(
T
.
order
(),
0
)
;
for
(
unsigned
int
j
=
0
;
j
<
T
.
nbElem
()
;
++
j
)
{
REAL
P
=
T
[
j
]
;
REAL
P
=
REAL
(
T
[
j
]
)
;
for
(
unsigned
int
k
=
0
;
k
<
T
.
order
()
;
++
k
)
P
*=
R
(
q
[
k
],
p
[
k
])
;
S
+=
P
;
...
...
@@ -1188,6 +1188,7 @@ QuadricHF<REAL>::buildLowerLeftIntegralMatrix_C(const REAL& alpha, unsigned int
return
C
;
}
template
<
typename
REAL
>
Geom
::
Tensor3d
*
QuadricHF
<
REAL
>::
tensorsFromCoefs
(
const
std
::
vector
<
VEC3
>&
coefs
)
...
...
@@ -1283,7 +1284,7 @@ QuadricHF<REAL>::coefsFromTensors(Geom::Tensor3d* A)
{
const
unsigned
int
&
degree
=
A
[
0
].
order
()
;
std
::
vector
<
VEC3
>
coefs
;
coefs
.
resize
(((
degree
+
1
)
*
(
degree
+
2
))
/
REAL
(
2
)
)
;
coefs
.
resize
(((
degree
+
1
)
*
(
degree
+
2
))
/
2
)
;
std
::
vector
<
unsigned
int
>
index
;
index
.
resize
(
degree
,
2
)
;
...
...
@@ -1356,4 +1357,3 @@ QuadricHF<REAL>::coefsFromTensors(Geom::Tensor3d* A)
}
// Utils
}
// CGOGN
CGoGN/include/Utils/quadricRGBfunctions.hpp
View file @
1c7c7d22
...
...
@@ -142,34 +142,34 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_A(MATRIX66 &M, const REAL al
REAL
alphaAbs
=
alpha
>
0
?
alpha
:
-
alpha
;
const
REAL
pi
=
3.141592
;
const
REAL
pi
=
3.141592
f
;
const
REAL
cosinus
=
cos
(
alpha
);
const
REAL
cosinus
=
std
::
cos
(
alpha
);
const
REAL
cos2
=
cosinus
*
cosinus
;
const
REAL
cos3
=
cos2
*
cosinus
;
const
REAL
sinus
=
sin
(
alpha
);
const
REAL
sinAbs
=
sin
(
alphaAbs
);
// = - sin(alpha) si alpha < 0
const
REAL
sinus
=
std
::
sin
(
alpha
);
const
REAL
sinAbs
=
std
::
sin
(
alphaAbs
);
// = - sin(alpha) si alpha < 0
// Line 1
M
(
0
,
0
)
=
2.0
*
(
pi
-
alphaAbs
)
/
5.0
f
;
M
(
0
,
1
)
=
2.0
*
(
pi
-
alphaAbs
-
cosinus
*
sinAbs
)
/
15.0
;
M
(
0
,
0
)
=
2.0
f
*
(
pi
-
alphaAbs
)
/
5.0
f
;
M
(
0
,
1
)
=
2.0
f
*
(
pi
-
alphaAbs
-
cosinus
*
sinAbs
)
/
15.0
f
;
M
(
0
,
2
)
=
0
;
M
(
0
,
3
)
=
0
;
M
(
0
,
4
)
=
sinAbs
*
pi
/
8.0
;
M
(
0
,
5
)
=
2.0
*
(
pi
-
alphaAbs
)
/
3.0
;
M
(
0
,
4
)
=
sinAbs
*
pi
/
8.0
f
;
M
(
0
,
5
)
=
2.0
f
*
(
pi
-
alphaAbs
)
/
3.0
f
;
// Line 2
M
(
1
,
0
)
=
M
(
0
,
1
);
M
(
1
,
1
)
=
(
-
4.0
*
sinAbs
*
cos3
+
6.0
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
))
/
15.0
;
M
(
1
,
1
)
=
(
-
4.0
f
*
sinAbs
*
cos3
+
6.0
f
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
))
/
15.0
f
;
M
(
1
,
2
)
=
REAL
(
0
);
M
(
1
,
3
)
=
REAL
(
0
);
M
(
1
,
4
)
=
(
sinus
*
cos2
*
pi
+
2
*
sinus
*
pi
)
/
8.0
;
M
(
1
,
5
)
=
2.0
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
3.0
;
M
(
1
,
4
)
=
(
sinus
*
cos2
*
pi
+
2
*
sinus
*
pi
)
/
8.0
f
;
M
(
1
,
5
)
=
2.0
f
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
3.0
f
;
// LINE 3
M
(
2
,
0
)
=
REAL
(
0
);
M
(
2
,
1
)
=
REAL
(
0
);
M
(
2
,
2
)
=
2.0
*
(
pi
-
alphaAbs
-
cosinus
*
sinAbs
)
/
15.0
;
M
(
2
,
2
)
=
2.0
f
*
(
pi
-
alphaAbs
-
cosinus
*
sinAbs
)
/
15.0
f
;
M
(
2
,
3
)
=
pi
*
sinus
/
8.0
f
;
M
(
2
,
4
)
=
REAL
(
0
)
;
M
(
2
,
5
)
=
REAL
(
0
)
;
...
...
@@ -178,7 +178,7 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_A(MATRIX66 &M, const REAL al
M
(
3
,
0
)
=
REAL
(
0
)
;
M
(
3
,
1
)
=
REAL
(
0
)
;
M
(
3
,
2
)
=
M
(
2
,
3
);
M
(
3
,
3
)
=
2.0
*
(
pi
-
alphaAbs
)
/
3.0
;
M
(
3
,
3
)
=
2.0
f
*
(
pi
-
alphaAbs
)
/
3.0
f
;
M
(
3
,
4
)
=
REAL
(
0
)
;
M
(
3
,
5
)
=
REAL
(
0
)
;
...
...
@@ -187,8 +187,8 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_A(MATRIX66 &M, const REAL al
M
(
4
,
1
)
=
M
(
1
,
4
)
;
M
(
4
,
2
)
=
REAL
(
0
)
;
M
(
4
,
3
)
=
REAL
(
0
)
;
M
(
4
,
4
)
=
2.0
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
3.0
;
M
(
4
,
5
)
=
pi
*
sinus
/
2.0
;
M
(
4
,
4
)
=
2.0
f
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
3.0
f
;
M
(
4
,
5
)
=
pi
*
sinus
/
2.0
f
;
// Line 6
M
(
5
,
0
)
=
M
(
0
,
5
)
;
...
...
@@ -196,7 +196,7 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_A(MATRIX66 &M, const REAL al
M
(
5
,
2
)
=
REAL
(
0
)
;
M
(
5
,
3
)
=
REAL
(
0
)
;
M
(
5
,
4
)
=
M
(
4
,
5
)
;
M
(
5
,
5
)
=
2.0
*
(
pi
-
alphaAbs
);
M
(
5
,
5
)
=
2.0
f
*
(
pi
-
alphaAbs
);
}
...
...
@@ -206,7 +206,7 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_b(MATRIX66 &M, const REAL al
// Int(phi=0..pi)(theta= -alpha..pi) variables*variablesRotated dTheta dPhi * coefs if alpha < 0
REAL
alphaAbs
=
alpha
>
0
?
alpha
:
-
alpha
;
const
REAL
pi
=
3.141592
;
const
REAL
pi
=
3.141592
f
;
const
REAL
cosinus
=
cos
(
alpha
)
;
const
REAL
cos2
=
cosinus
*
cosinus
;
...
...
@@ -217,25 +217,25 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_b(MATRIX66 &M, const REAL al
const
REAL
sinAbs
=
sin
(
alphaAbs
)
;
// = - sin(alpha) si alpha < 0
// Line 1
M
(
0
,
0
)
=
2.0
*
(
pi
-
alphaAbs
)
/
5.0
f
;
M
(
0
,
1
)
=
(
6
*
cosinus
*
sinAbs
-
8
*
sinAbs
*
cos3
-
2
*
alphaAbs
+
2
*
pi
)
/
15.0
;
M
(
0
,
0
)
=
2.0
f
*
(
pi
-
alphaAbs
)
/
5.0
f
;
M
(
0
,
1
)
=
(
6
*
cosinus
*
sinAbs
-
8
*
sinAbs
*
cos3
-
2
*
alphaAbs
+
2
*
pi
)
/
15.0
f
;
M
(
0
,
2
)
=
0
;
M
(
0
,
3
)
=
0
;
M
(
0
,
4
)
=
(
sinus
*
pi
+
2
*
pi
*
cosinus
*
sinus
)
/
8.0
;
M
(
0
,
5
)
=
2.0
*
(
pi
-
alphaAbs
)
/
3.0
;
M
(
0
,
4
)
=
(
sinus
*
pi
+
2
*
pi
*
cosinus
*
sinus
)
/
8.0
f
;
M
(
0
,
5
)
=
2.0
f
*
(
pi
-
alphaAbs
)
/
3.0
f
;
// Line 2
M
(
1
,
0
)
=
2
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
15.0
;
M
(
1
,
1
)
=
(
6
*
cosinus
*
sinAbs
-
2
*
alphaAbs
+
2
*
pi
-
16
*
sinAbs
*
cos5
+
4
*
cos2
*
pi
-
4
*
alphaAbs
*
cos2
)
/
15.0
;
M
(
1
,
0
)
=
2
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
15.0
f
;
M
(
1
,
1
)
=
(
6
*
cosinus
*
sinAbs
-
2
*
alphaAbs
+
2
*
pi
-
16
*
sinAbs
*
cos5
+
4
*
cos2
*
pi
-
4
*
alphaAbs
*
cos2
)
/
15.0
f
;
M
(
1
,
2
)
=
0
;
M
(
1
,
3
)
=
0
;
M
(
1
,
4
)
=
(
sinus
*
pi
+
2
*
(
pi
*
sinus
*
cos3
+
pi
*
cosinus
*
sinus
))
/
8.0
;
M
(
1
,
5
)
=
2.0
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
3.0
;
M
(
1
,
4
)
=
(
sinus
*
pi
+
2
*
(
pi
*
sinus
*
cos3
+
pi
*
cosinus
*
sinus
))
/
8.0
f
;
M
(
1
,
5
)
=
2.0
f
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
3.0
f
;
// LINE 3
M
(
2
,
0
)
=
REAL
(
0
);
M
(
2
,
1
)
=
REAL
(
0
);
M
(
2
,
2
)
=
2
*
(
sinAbs
-
cosinus
*
alphaAbs
+
cosinus
*
pi
-
2
*
cos2
*
sinAbs
)
/
15.0
;
M
(
2
,
2
)
=
2
*
(
sinAbs
-
cosinus
*
alphaAbs
+
cosinus
*
pi
-
2
*
cos2
*
sinAbs
)
/
15.0
f
;
M
(
2
,
3
)
=
pi
*
sinus
/
8.0
f
;
M
(
2
,
4
)
=
REAL
(
0
)
;
M
(
2
,
5
)
=
REAL
(
0
)
;
...
...
@@ -243,26 +243,26 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_b(MATRIX66 &M, const REAL al
// Line 4
M
(
3
,
0
)
=
REAL
(
0
)
;
M
(
3
,
1
)
=
REAL
(
0
)
;
M
(
3
,
2
)
=
(
sinus
*
pi
+
2
*
pi
*
cosinus
*
sinus
)
/
8.0
;
M
(
3
,
3
)
=
2.0
*
(
pi
-
alphaAbs
)
/
3.0
;
M
(
3
,
2
)
=
(
sinus
*
pi
+
2
*
pi
*
cosinus
*
sinus
)
/
8.0
f
;
M
(
3
,
3
)
=
2.0
f
*
(
pi
-
alphaAbs
)
/
3.0
f
;
M
(
3
,
4
)
=
REAL
(
0
)
;
M
(
3
,
5
)
=
REAL
(
0
)
;
// Line 5
M
(
4
,
0
)
=
pi
*
sinus
/
8.0
;
M
(
4
,
1
)
=
(
sinus
*
pi
+
4
*
sinus
*
cos4
+
2
*
pi
*
cosinus
*
sinus
)
/
8.0
;
M
(
4
,
0
)
=
pi
*
sinus
/
8.0
f
;
M
(
4
,
1
)
=
(
sinus
*
pi
+
4
*
sinus
*
cos4
+
2
*
pi
*
cosinus
*
sinus
)
/
8.0
f
;
M
(
4
,
2
)
=
REAL
(
0
)
;
M
(
4
,
3
)
=
REAL
(
0
)
;
M
(
4
,
4
)
=
2
*
(
sinAbs
-
cosinus
*
alphaAbs
+
cosinus
*
pi
-
2
*
cos2
*
sinAbs
)
/
3.0
;
M
(
4
,
5
)
=
pi
*
sinus
/
2.0
;
M
(
4
,
4
)
=
2
*
(
sinAbs
-
cosinus
*
alphaAbs
+
cosinus
*
pi
-
2
*
cos2
*
sinAbs
)
/
3.0
f
;
M
(
4
,
5
)
=
pi
*
sinus
/
2.0
f
;
// Line 6
M
(
5
,
0
)
=
M
(
0
,
5
)
;
M
(
5
,
1
)
=
2
*
cosinus
*
sinAbs
+
2
*
(
pi
-
4
*
sinAbs
*
cos3
-
alphaAbs
)
/
3.0
;
M
(
5
,
1
)
=
2
*
cosinus
*
sinAbs
+
2
*
(
pi
-
4
*
sinAbs
*
cos3
-
alphaAbs
)
/
3.0
f
;
M
(
5
,
2
)
=
REAL
(
0
)
;
M
(
5
,
3
)
=
REAL
(
0
)
;
M
(
5
,
4
)
=
sinus
*
pi
/
2.0
+
pi
*
cosinus
*
sinus
;
M
(
5
,
5
)
=
2.0
*
(
pi
-
alphaAbs
);
M
(
5
,
4
)
=
sinus
*
pi
/
2.0
f
+
pi
*
cosinus
*
sinus
;
M
(
5
,
5
)
=
2.0
f
*
(
pi
-
alphaAbs
);
}
template
<
typename
REAL
>
...
...
@@ -272,7 +272,7 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_c(MATRIX66 &M, const REAL al
REAL
alphaAbs
=
alpha
>
0
?
alpha
:
-
alpha
;
const
REAL
pi
=
3.141592
;
const
REAL
pi
=
3.141592
f
;
const
REAL
cosinus
=
cos
(
alpha
);
const
REAL
cos2
=
cosinus
*
cosinus
;
...
...
@@ -283,25 +283,25 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_c(MATRIX66 &M, const REAL al
const
REAL
sinAbs
=
sin
(
alphaAbs
);
// = - sin(alpha) si alpha < 0
// Line 1
M
(
0
,
0
)
=
2.0
*
(
pi
-
alphaAbs
)
/
5.0
f
;
M
(
0
,
1
)
=
2.0
*
(
3
*
cosinus
*
sinAbs
-
4
*
sinAbs
*
cos3
-
alphaAbs
+
pi
)
/
15.0
;
M
(
0
,
0
)
=
2.0
f
*
(
pi
-
alphaAbs
)
/
5.0
f
;
M
(
0
,
1
)
=
2.0
f
*
(
3
*
cosinus
*
sinAbs
-
4
*
sinAbs
*
cos3
-
alphaAbs
+
pi
)
/
15.0
f
;
M
(
0
,
2
)
=
0
;
M
(
0
,
3
)
=
0
;
M
(
0
,
4
)
=
(
sinus
*
pi
+
2
*
pi
*
cosinus
*
sinus
)
/
8.0
;
M
(
0
,
5
)
=
2.0
*
(
pi
-
alphaAbs
)
/
3.0
;