ConePrimitiveShapeConstructor.cpp
Go to the documentation of this file.
1
#include "
ConePrimitiveShapeConstructor.h
"
2
3
#include "
Cone.h
"
4
#include "
ConePrimitiveShape.h
"
5
#include "
ScoreComputer.h
"
6
#include <
GfxTL/NullClass.h
>
7
8
size_t
9
ConePrimitiveShapeConstructor::Identifier
()
const
10
{
11
return
3;
12
}
13
14
unsigned
int
15
ConePrimitiveShapeConstructor::RequiredSamples
()
const
16
{
17
return
3;
18
}
19
20
PrimitiveShape
*
21
ConePrimitiveShapeConstructor::Construct
(
const
MiscLib::Vector<Vec3f>
& points,
22
const
MiscLib::Vector<Vec3f>
& normals)
const
23
{
24
Cone
cone;
25
if
(!cone.
Init
(points[0], points[1], points[2], normals[0], normals[1], normals[2]))
26
{
27
return
NULL;
28
}
29
if
(cone.
Angle
() > 1.4835298641951801403851371532153)
30
// do not allow cones with an opening angle of more than 85 degrees
31
{
32
return
NULL;
33
}
34
return
new
ConePrimitiveShape
(cone);
35
}
36
37
PrimitiveShape
*
38
ConePrimitiveShapeConstructor::Construct
(
const
MiscLib::Vector<Vec3f>
& samples)
const
39
{
40
Cone
cone;
41
if
(!cone.
Init
(samples))
42
{
43
return
NULL;
44
}
45
return
new
ConePrimitiveShape
(cone);
46
}
47
48
PrimitiveShape
*
49
ConePrimitiveShapeConstructor::Deserialize
(std::istream* i,
bool
binary)
const
50
{
51
Cone
cone;
52
cone.
Init
(binary, i);
53
ConePrimitiveShape
* shape =
new
ConePrimitiveShape
(cone);
54
return
shape;
55
}
56
57
size_t
58
ConePrimitiveShapeConstructor::SerializedSize
()
const
59
{
60
return
Cone::SerializedSize
();
61
}
ConePrimitiveShape
Definition:
ConePrimitiveShape.h:11
ConePrimitiveShapeConstructor::Construct
PrimitiveShape * Construct(const MiscLib::Vector< Vec3f > &points, const MiscLib::Vector< Vec3f > &normals) const
Definition:
ConePrimitiveShapeConstructor.cpp:21
PrimitiveShape
PrimtiveShape is a shape primitive in conjunction with a parametrization.
Definition:
PrimitiveShape.h:34
MiscLib::Vector
Definition:
Vector.h:19
ConePrimitiveShape
class DLL_LINKAGE ConePrimitiveShape
Definition:
PrimitiveShapeVisitor.h:11
ConePrimitiveShapeConstructor::SerializedSize
size_t SerializedSize() const
Definition:
ConePrimitiveShapeConstructor.cpp:58
ConePrimitiveShapeConstructor::Identifier
size_t Identifier() const
Definition:
ConePrimitiveShapeConstructor.cpp:9
Cone
Definition:
Cone.h:24
Cone.h
Cone::Init
bool Init(const MiscLib::Vector< Vec3f > &samples)
Definition:
Cone.cpp:47
Cone::Angle
float Angle() const
Definition:
Cone.h:389
Cone::SerializedSize
static size_t SerializedSize()
Definition:
Cone.cpp:745
ConePrimitiveShapeConstructor.h
NullClass.h
ScoreComputer.h
ConePrimitiveShape.h
ConePrimitiveShapeConstructor::Deserialize
PrimitiveShape * Deserialize(std::istream *i, bool binary=true) const
Definition:
ConePrimitiveShapeConstructor.cpp:49
ConePrimitiveShapeConstructor::RequiredSamples
unsigned int RequiredSamples() const
Definition:
ConePrimitiveShapeConstructor.cpp:15
VisionX
components
pointcloud_processor
EfficientRANSACPrimitiveExtractor
EfficientRANSAC
ConePrimitiveShapeConstructor.cpp
Generated by
1.8.17