SpherePrimitiveShapeConstructor.cpp
Go to the documentation of this file.
1
#include "
SpherePrimitiveShapeConstructor.h
"
2
#include "
SpherePrimitiveShape.h
"
3
#include "
ScoreComputer.h
"
4
#include <
GfxTL/NullClass.h
>
5
6
SpherePrimitiveShapeConstructor::SpherePrimitiveShapeConstructor
(
7
float
maxSphereRadius)
8
: m_maxSphereRadius(maxSphereRadius)
9
{}
10
11
size_t
SpherePrimitiveShapeConstructor::Identifier
()
const
12
{
13
return
1;
14
}
15
16
unsigned
int
SpherePrimitiveShapeConstructor::RequiredSamples
()
const
17
{
18
// we use only 2pts with normals
19
return
2;
//4;
20
}
21
22
PrimitiveShape
*
SpherePrimitiveShapeConstructor::Construct
(
23
const
MiscLib::Vector< Vec3f >
& points,
24
const
MiscLib::Vector< Vec3f >
& normals)
const
25
{
26
Sphere
sphere;
27
if
(!sphere.
Init2
(points[0], points[1], normals[0], normals[1]))
//points[2], points[3]))
28
{
29
return
NULL;
30
}
31
if
(sphere.
Radius
() > m_maxSphereRadius)
32
{
33
return
NULL;
34
}
35
return
new
SpherePrimitiveShape
(sphere);
36
}
37
38
PrimitiveShape
*
SpherePrimitiveShapeConstructor::Construct
(
39
const
MiscLib::Vector< Vec3f >
& samples)
const
40
{
41
Sphere
sphere;
42
if
(!sphere.
Init
(samples))
43
{
44
return
NULL;
45
}
46
return
new
SpherePrimitiveShape
(sphere);
47
}
48
49
PrimitiveShape
*
SpherePrimitiveShapeConstructor::Deserialize
(std::istream* i,
50
bool
binary)
const
51
{
52
SpherePrimitiveShape
* shape =
new
SpherePrimitiveShape
();
53
shape->
Deserialize
(i, binary);
54
return
shape;
55
}
56
57
size_t
SpherePrimitiveShapeConstructor::SerializedSize
()
const
58
{
59
return
Sphere::SerializedSize
()
60
+
SpherePrimitiveShape::ParametrizationType::SerializedSize
();
61
}
SpherePrimitiveShapeConstructor::RequiredSamples
unsigned int RequiredSamples() const
Definition:
SpherePrimitiveShapeConstructor.cpp:16
SpherePrimitiveShape.h
Sphere::SerializedSize
static size_t SerializedSize()
Definition:
Sphere.cpp:427
PrimitiveShape
PrimtiveShape is a shape primitive in conjunction with a parametrization.
Definition:
PrimitiveShape.h:32
Sphere::Init2
bool Init2(const Vec3f &p1, const Vec3f &p2, const Vec3f &n1, const Vec3f &n2)
Definition:
Sphere.cpp:242
MiscLib::Vector
Definition:
Vector.h:19
SpherePrimitiveShapeConstructor::Deserialize
PrimitiveShape * Deserialize(std::istream *i, bool binary=true) const
Definition:
SpherePrimitiveShapeConstructor.cpp:49
SpherePrimitiveShapeConstructor::Construct
PrimitiveShape * Construct(const MiscLib::Vector< Vec3f > &points, const MiscLib::Vector< Vec3f > &normals) const
Definition:
SpherePrimitiveShapeConstructor.cpp:22
SpherePrimitiveShape
class DLL_LINKAGE SpherePrimitiveShape
Definition:
PrimitiveShapeVisitor.h:9
SpherePrimitiveShapeConstructor::SpherePrimitiveShapeConstructor
SpherePrimitiveShapeConstructor(float maxSphereRadius=std::numeric_limits< float >::infinity())
Definition:
SpherePrimitiveShapeConstructor.cpp:6
LowStretchSphereParametrization::SerializedSize
static size_t SerializedSize()
Definition:
LowStretchSphereParametrization.cpp:107
SpherePrimitiveShapeConstructor::Identifier
size_t Identifier() const
Definition:
SpherePrimitiveShapeConstructor.cpp:11
SpherePrimitiveShapeConstructor.h
Sphere::Init
bool Init(const MiscLib::Vector< Vec3f > &samples)
Definition:
Sphere.cpp:172
NullClass.h
ScoreComputer.h
Sphere
Definition:
Sphere.h:27
SpherePrimitiveShape
Definition:
SpherePrimitiveShape.h:19
SpherePrimitiveShape::Deserialize
void Deserialize(std::istream *i, bool binary)
Definition:
SpherePrimitiveShape.cpp:278
Sphere::Radius
float Radius() const
Definition:
Sphere.cpp:351
SpherePrimitiveShapeConstructor::SerializedSize
size_t SerializedSize() const
Definition:
SpherePrimitiveShapeConstructor.cpp:57
VisionX
components
pointcloud_processor
EfficientRANSACPrimitiveExtractor
EfficientRANSAC
SpherePrimitiveShapeConstructor.cpp
Generated on Sat Oct 12 2024 09:14:17 for armarx_documentation by
1.8.17