Choreonoid  1.1
TriangleMeshShaper.h
説明を見る。
1 
6 #ifndef CNOID_UTIL_TRIANGLE_MESH_SHAPER_H_INCLUDED
7 #define CNOID_UTIL_TRIANGLE_MESH_SHAPER_H_INCLUDED
8 
9 #include "VrmlNodes.h"
10 #include <boost/signal.hpp>
11 #include "exportdecl.h"
12 
13 namespace cnoid
14 {
15  class TMSImpl;
16 
18  {
19  public:
20 
23 
24  void setDivisionNumber(int n);
25  void setNormalGenerationMode(bool on);
26  VrmlNodePtr apply(VrmlNodePtr topNode);
27  SFNode getOriginalGeometry(VrmlShapePtr shapeNode);
28  void defaultTextureMapping(VrmlShape* shapeNode);
29 
30  boost::signal<void(const std::string& message)> sigMessage;
31 
32  bool convertBox(VrmlBox* box, VrmlIndexedFaceSetPtr& triangleMesh);
33 
34  private:
35  TMSImpl* impl;
36 
37  void defaultTextureMappingFaceSet(VrmlIndexedFaceSet* triangleMesh);
38  void defaultTextureMappingElevationGrid(VrmlElevationGrid* grid, VrmlIndexedFaceSet* triangleMesh);
39  void defaultTextureMappingBox(VrmlIndexedFaceSet* triangleMesh);
40  void defaultTextureMappingCone(VrmlIndexedFaceSet* triangleMesh);
41  void defaultTextureMappingCylinder(VrmlIndexedFaceSet* triangleMesh);
42  void defaultTextureMappingSphere(VrmlIndexedFaceSet* triangleMesh, double radius);
43  void defaultTextureMappingExtrusion(VrmlIndexedFaceSet* triangleMesh, VrmlExtrusion* extrusion );
44  int faceofBox(SFVec3f* point);
45  int findPoint(MFVec2f& points, SFVec2f& target);
46  double calcangle(SFVec3f& point);
47  };
48 
49  enum { LEFT, TOP, FRONT, BOTTOM, RIGHT, BACK };
50 
51 };
52 
53 #endif
54