Go to the documentation of this file.
6 #ifndef CNOID_UTIL_MESH_GENERATOR_H
7 #define CNOID_UTIL_MESH_GENERATOR_H
11 #include "exportdecl.h"
24 void setDivisionNumber(
int n);
26 static int defaultDivisionNumber();
31 extraDivisionNumber_ = n;
32 extraDivisionMode_ = mode;
37 void setNormalGenerationEnabled(
bool on);
38 [[deprecated(
"Use setNormalGenerationEnabled")]]
39 void enableNormalGeneration(
bool on);
40 bool isNormalGenerationEnabled()
const;
42 void setBoundingBoxUpdateEnabled(
bool on);
43 bool isBoundingBoxUpdateEnabled()
const;
50 bool updateMeshWithPrimitiveInformation(
SgMesh* mesh,
int options = NoOption);
52 SgMesh* generateBox(
const Vector3& size,
int options = NoOption);
53 SgMesh* generateSphere(
double radius,
int options = NoOption);
54 SgMesh* generateCylinder(
double radius,
double height,
int options = NoOption);
55 SgMesh* generateCone(
double radius,
double height,
int options = NoOption);
56 SgMesh* generateCapsule(
double radius,
double height);
57 SgMesh* generateDisc(
double radius,
double innerRadius);
58 SgMesh* generateArrow(
double cylinderRadius,
double cylinderHeight,
double coneRadius,
double coneHeight);
59 SgMesh* generateTorus(
double radius,
double crossSectionRadius);
60 SgMesh* generateTorus(
double radius,
double crossSectionRadius,
double beginAngle,
double endAngle);
62 typedef std::vector<Vector2, Eigen::aligned_allocator<Vector2>>
Vector2Array;
63 typedef std::vector<Vector3, Eigen::aligned_allocator<Vector3>>
Vector3Array;
64 typedef std::vector<AngleAxis, Eigen::aligned_allocator<AngleAxis>>
AngleAxisArray;
82 SgMesh* generateExtrusion(
const Extrusion& extrusion,
int meshOptions = NoOption);
83 SgLineSet* generateExtrusionLineSet(
const Extrusion& extrusion,
SgMesh* mesh);
104 SgMesh* generateElevationGrid(
const ElevationGrid& elevationGrid,
int meshOptions = NoOption);
106 void generateTextureCoordinateForIndexedFaceSet(
SgMeshBase* mesh);
110 int extraDivisionNumber_;
111 int extraDivisionMode_;
112 bool isNormalGenerationEnabled_;
113 bool isBoundingBoxUpdateEnabled_;
117 void generateNormals(
SgMesh* mesh,
double creaseAngle);
118 bool generateBox(
SgMesh* mesh,
int options);
119 bool generateBoxWithExtraTriangles(
SgMesh* mesh);
120 void generateTextureCoordinateForBox(
SgMesh* mesh);
121 void generateBoxPlaneMesh(
123 bool generateSphere(
SgMesh* mesh,
int options);
124 bool generateCylinder(
SgMesh* mesh,
int options);
125 bool generateCone(
SgMesh* mesh,
int options);
126 bool generateCapsule(
SgMesh* mesh);
127 void generateTextureCoordinateForSphere(
SgMesh* mesh);
128 void generateTextureCoordinateForCylinder(
SgMesh* mesh);
129 void generateTextureCoordinateForCone(
SgMesh* mesh);
130 void generateTextureCoordinateForExtrusion(
131 SgMesh* mesh,
const Vector2Array& crossSections,
const Vector3Array& spinePoints,
132 int numTriOfbeginCap,
int numTriOfendCap,
int indexOfendCap);
133 void generateTextureCoordinateForElevationGrid(
SgMesh* mesh,
const ElevationGrid& grid);
std::vector< Vector2, Eigen::aligned_allocator< Vector2 > > Vector2Array
Definition: MeshGenerator.h:62
int extraDivisionNumber() const
Definition: MeshGenerator.h:34
AngleAxisArray orientation
Definition: MeshGenerator.h:70
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
std::vector< double > height
Definition: MeshGenerator.h:91
Definition: SceneDrawables.h:337
MeshOption
Definition: MeshGenerator.h:45
Definition: MeshGenerator.h:85
Definition: SceneDrawables.h:660
Definition: MeshFilter.h:17
Definition: MeshGenerator.h:17
int extraDivisionMode() const
Definition: MeshGenerator.h:35
int zDimension
Definition: MeshGenerator.h:88
@ ExtraDivisionPreferred
Definition: SceneDrawables.h:476
int divisionNumber() const
Definition: MeshGenerator.h:25
bool endCap
Definition: MeshGenerator.h:74
double creaseAngle
Definition: MeshGenerator.h:72
double creaseAngle
Definition: MeshGenerator.h:93
Definition: AbstractSceneLoader.h:11
Vector2Array crossSection
Definition: MeshGenerator.h:68
int xDimension
Definition: MeshGenerator.h:87
bool beginCap
Definition: MeshGenerator.h:73
Extrusion()
Definition: MeshGenerator.h:75
Vector3Array spine
Definition: MeshGenerator.h:69
double zSpacing
Definition: MeshGenerator.h:90
void setExtraDivisionNumber(int n, int mode=SgMesh::ExtraDivisionPreferred)
Definition: MeshGenerator.h:30
Definition: SceneDrawables.h:256
Definition: MeshGenerator.h:66
bool ccw
Definition: MeshGenerator.h:92
Vector2Array scale
Definition: MeshGenerator.h:71
double xSpacing
Definition: MeshGenerator.h:89
std::vector< AngleAxis, Eigen::aligned_allocator< AngleAxis > > AngleAxisArray
Definition: MeshGenerator.h:64
ElevationGrid()
Definition: MeshGenerator.h:94
std::vector< Vector3, Eigen::aligned_allocator< Vector3 > > Vector3Array
Definition: MeshGenerator.h:63