CylinderPrimitiveShapeConstructor.cpp
Go to the documentation of this file.
2 #include "ScoreComputer.h"
3 #include <GfxTL/NullClass.h>
4 
6 {
7  return 2;
8 }
9 
11 {
12  return 2;
13 }
14 
16  const MiscLib::Vector< Vec3f >& points,
17  const MiscLib::Vector< Vec3f >& normals) const
18 {
19  Cylinder cy;
20  MiscLib::Vector< Vec3f > samples(points);
21  std::copy(normals.begin(), normals.end(), std::back_inserter(samples));
22  if (!cy.Init(samples))
23  {
24  return NULL;
25  }
26  return new CylinderPrimitiveShape(cy);
27 }
28 
30  const MiscLib::Vector< Vec3f >& samples) const
31 {
32  Cylinder cy;
33  if (!cy.Init(samples))
34  {
35  return NULL;
36  }
37  return new CylinderPrimitiveShape(cy);
38 }
39 
41  std::istream* i, bool binary) const
42 {
43  Cylinder cylinder;
44  cylinder.Init(binary, i);
45  CylinderPrimitiveShape* shape = new CylinderPrimitiveShape(cylinder);
46  return shape;
47 }
48 
50 {
51  return Cylinder::SerializedSize();
52 }
CylinderPrimitiveShapeConstructor.h
CylinderPrimitiveShapeConstructor::SerializedSize
size_t SerializedSize() const
Definition: CylinderPrimitiveShapeConstructor.cpp:49
MiscLib::Vector::begin
T * begin()
Definition: Vector.h:460
Cylinder::SerializedSize
static size_t SerializedSize()
Definition: Cylinder.cpp:465
PrimitiveShape
PrimtiveShape is a shape primitive in conjunction with a parametrization.
Definition: PrimitiveShape.h:32
MiscLib::Vector
Definition: Vector.h:19
CylinderPrimitiveShape
class DLL_LINKAGE CylinderPrimitiveShape
Definition: PrimitiveShapeVisitor.h:10
copy
Use of this software is granted under one of the following two to be chosen freely by the user Boost Software License Version Marcin Kalicinski Permission is hereby free of to any person or organization obtaining a copy of the software and accompanying documentation covered by this and transmit the and to prepare derivative works of the and to permit third parties to whom the Software is furnished to do all subject to the including the above license this restriction and the following must be included in all copies of the in whole or in and all derivative works of the unless such copies or derivative works are solely in the form of machine executable object code generated by a source language processor THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR A PARTICULAR TITLE AND NON INFRINGEMENT IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN TORT OR ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE The MIT Marcin Kalicinski Permission is hereby free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to copy
Definition: license.txt:39
CylinderPrimitiveShape
Definition: CylinderPrimitiveShape.h:11
MiscLib::Vector::end
T * end()
Definition: Vector.h:470
CylinderPrimitiveShapeConstructor::Identifier
size_t Identifier() const
Definition: CylinderPrimitiveShapeConstructor.cpp:5
CylinderPrimitiveShapeConstructor::Construct
PrimitiveShape * Construct(const MiscLib::Vector< Vec3f > &points, const MiscLib::Vector< Vec3f > &normals) const
Definition: CylinderPrimitiveShapeConstructor.cpp:15
CylinderPrimitiveShapeConstructor::RequiredSamples
unsigned int RequiredSamples() const
Definition: CylinderPrimitiveShapeConstructor.cpp:10
NullClass.h
ScoreComputer.h
Cylinder
Definition: Cylinder.h:20
CylinderPrimitiveShapeConstructor::Deserialize
PrimitiveShape * Deserialize(std::istream *i, bool binary=true) const
Definition: CylinderPrimitiveShapeConstructor.cpp:40
Cylinder::Init
bool Init(const MiscLib::Vector< Vec3f > &samples)
Definition: Cylinder.cpp:37