DataGenerator.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Geometry
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2014, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeGeometry/Base.h"
16 #include "CeeCore/PtrRef.h"
17 #include "CeeGeometry/DataIndexedTriangles.h"
18 #include "CeeGeometry/DataIndexedPolylines.h"
19 
20 namespace cee {
21 namespace geo {
22 
23 
24 //==================================================================================================
25 //
26 //
27 //
28 //==================================================================================================
29 class CEE_GEO_EXPORT DataGenerator
30 {
31 public:
32  static PtrRef<DataIndexedTriangles> createSphere(const Vec3d& centerPos, double radius, size_t numSubDivisions);
33  static PtrRef<DataIndexedTriangles> createCylinder(const Vec3d& bottomCenterPos, double outerRadius, double innerRadius, const Vec3d& heightDirection, double height, size_t numSubDivisions);
34  static PtrRef<DataIndexedPolylines> createCircle(const Vec3d& centerPos, double radius, const Vec3d& normal, size_t numSubDivisions);
35  static PtrRef<DataIndexedPolylines> createArc(const Vec3d& centerPos, double radius, const Vec3d& normal, const Vec3d& startDirection, double angle, size_t numSubDivisions);
36  static PtrRef<DataIndexedTriangles> createBox(const Vec3d& centerPos, const Vec3d& totalExtent);
37  static PtrRef<DataIndexedPolylines> createLineSegments(const std::vector<Vec3d>& vertices);
38  static PtrRef<DataIndexedTriangles> createTriangles(const std::vector<Vec3d>& vertices, double creaseAngleDegrees = 0.0);
39  static PtrRef<DataIndexedTriangles> createTriangles(const std::vector<Vec3d>& vertices, const std::vector<unsigned int>& indices, double creaseAngleDegrees = 0.0);
40 
41 private:
42  DataGenerator();
43  CEE_DISALLOW_COPY_AND_ASSIGN(DataGenerator);
44 };
45 
46 } // namespace geo
47 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Smart pointer class used for handling reference counted objects (that derive from Object)...
Definition: PtrRef.h:26
Helper class for generating various primitives (spheres, cylinders, boxes, etc) for use in the Geomet...
Definition: DataGenerator.h:29
Vector class for a 3D double vector.
Definition: Vec3d.h:26