Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00014 #ifndef HRPUTIL_TRIANGLE_MESH_SHAPER_H_INCLUDED
00015 #define HRPUTIL_TRIANGLE_MESH_SHAPER_H_INCLUDED
00016
00017 #include "config.h"
00018 #include "VrmlNodes.h"
00019 #include <string>
00020 #include <boost/version.hpp>
00021 #if (BOOST_VERSION >= 103900)
00022 #include <boost/signals2/signal.hpp>
00023 #else
00024 #include <boost/signal.hpp>
00025 #endif
00026
00027 namespace hrp
00028 {
00029 class TMSImpl;
00030
00031 class HRP_UTIL_EXPORT TriangleMeshShaper
00032 {
00033 public:
00034
00035 TriangleMeshShaper();
00036 ~TriangleMeshShaper();
00037
00038 void setDivisionNumber(int n);
00039 void setNormalGenerationMode(bool on);
00040 VrmlNodePtr apply(VrmlNodePtr topNode);
00041 SFNode getOriginalGeometry(VrmlShapePtr shapeNode);
00042 void defaultTextureMapping(VrmlShape* shapeNode);
00043
00044 #if (BOOST_VERSION >= 103900)
00045 boost::signals2::signal<void(const std::string& message)> sigMessage;
00046 #else
00047 boost::signal<void(const std::string& message)> sigMessage;
00048 #endif
00049
00050 bool convertBox(VrmlBox* box, VrmlIndexedFaceSetPtr& triangleMesh);
00051
00052 private:
00053 TMSImpl* impl;
00054
00055 void defaultTextureMappingFaceSet(VrmlIndexedFaceSet* triangleMesh);
00056 void defaultTextureMappingElevationGrid(VrmlElevationGrid* grid, VrmlIndexedFaceSet* triangleMesh);
00057 void defaultTextureMappingBox(VrmlIndexedFaceSet* triangleMesh);
00058 void defaultTextureMappingCone(VrmlIndexedFaceSet* triangleMesh);
00059 void defaultTextureMappingCylinder(VrmlIndexedFaceSet* triangleMesh);
00060 void defaultTextureMappingSphere(VrmlIndexedFaceSet* triangleMesh, double radius);
00061 void defaultTextureMappingExtrusion(VrmlIndexedFaceSet* triangleMesh, VrmlExtrusion* extrusion );
00062 int faceofBox(SFVec3f* point);
00063 int findPoint(MFVec2f& points, SFVec2f& target);
00064 double calcangle(SFVec3f& point);
00065 };
00066
00067 enum { LEFT, TOP, FRONT, BOTTOM, RIGHT, BACK };
00068
00069 };
00070
00071 #endif
00072