PlanePrimitiveShapeConstructor.cpp
Go to the documentation of this file.
2 
3 #include "PlanePrimitiveShape.h"
4 #include "ScoreComputer.h"
5 #include <GfxTL/NullClass.h>
6 
7 size_t
9 {
10  return 0;
11 }
12 
13 unsigned int
15 {
16  return 3;
17 }
18 
21  const MiscLib::Vector<Vec3f>&) const
22 {
23  return new PlanePrimitiveShape(points[0], points[1], points[2]);
24 }
25 
28 {
29  Plane plane;
30  if (!plane.Init(samples))
31  {
32  return NULL;
33  }
34  return new PlanePrimitiveShape(plane);
35 }
36 
38 PlanePrimitiveShapeConstructor::Deserialize(std::istream* i, bool binary) const
39 {
40  Plane plane;
41  plane.Init(binary, i);
42  PlanePrimitiveShape* shape = new PlanePrimitiveShape(plane);
43  return shape;
44 }
45 
46 size_t
48 {
49  return Plane::SerializedSize();
50 }
PlanePrimitiveShape.h
PrimitiveShape
PrimtiveShape is a shape primitive in conjunction with a parametrization.
Definition: PrimitiveShape.h:34
PlanePrimitiveShapeConstructor.h
PlanePrimitiveShapeConstructor::RequiredSamples
unsigned int RequiredSamples() const
Definition: PlanePrimitiveShapeConstructor.cpp:14
MiscLib::Vector
Definition: Vector.h:19
Plane::SerializedSize
static size_t SerializedSize()
Definition: Plane.cpp:259
PlanePrimitiveShapeConstructor::Construct
PrimitiveShape * Construct(const MiscLib::Vector< Vec3f > &points, const MiscLib::Vector< Vec3f > &normals) const
Definition: PlanePrimitiveShapeConstructor.cpp:20
PlanePrimitiveShape
Definition: PlanePrimitiveShape.h:15
PlanePrimitiveShapeConstructor::SerializedSize
size_t SerializedSize() const
Definition: PlanePrimitiveShapeConstructor.cpp:47
PlanePrimitiveShapeConstructor::Deserialize
PrimitiveShape * Deserialize(std::istream *i, bool binary=true) const
Definition: PlanePrimitiveShapeConstructor.cpp:38
Plane::Init
bool Init(Vec3f p1, Vec3f p2, Vec3f p3)
Definition: Plane.cpp:30
PlanePrimitiveShapeConstructor::Identifier
size_t Identifier() const
Definition: PlanePrimitiveShapeConstructor.cpp:8
NullClass.h
Plane
Definition: Plane.h:18
ScoreComputer.h
PlanePrimitiveShape
class DLL_LINKAGE PlanePrimitiveShape
Definition: PrimitiveShapeVisitor.h:8