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