00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _OSGGEOFUNCTIONS_H_
00038 #define _OSGGEOFUNCTIONS_H_
00039
00040 #ifdef __sgi
00041 #pragma once
00042 #endif
00043
00044 #include "OSGDrawableDef.h"
00045 #include "OSGBaseTypes.h"
00046 #include "OSGGeometry.h"
00047 #include "OSGGeoStatsAttachment.h"
00048
00049 OSG_BEGIN_NAMESPACE
00050
00051
00052 OSG_DRAWABLE_DLLMAPPING
00053 void calcVertexNormals (GeometryPtrArg geo );
00054
00055 OSG_DRAWABLE_DLLMAPPING
00056 void calcVertexNormals (GeometryPtrArg geo,
00057 Real32 creaseAngle);
00058 OSG_DRAWABLE_DLLMAPPING
00059 void calcFaceNormals (GeometryPtrArg geo );
00060
00061 OSG_DRAWABLE_DLLMAPPING
00062 void calcVertexTangentsProp (GeometryPtrArg geo,
00063 UInt32 srcTexProp,
00064 UInt32 srcNormalProp,
00065 UInt32 dstPropTan,
00066 UInt32 dstPropBin);
00067
00068 OSG_DRAWABLE_DLLMAPPING
00069 void calcVertexTangents (GeometryPtrArg geo,
00070 UInt32 srcTexIndex,
00071 UInt32 dstPropTan,
00072 UInt32 dstPropBin);
00073
00074 OSG_DRAWABLE_DLLMAPPING
00075 void calcVertexTexCoordsProp2D(GeometryPtr geo,
00076 UInt32 propIndex =
00077 Geometry::TexCoordsIndex);
00078
00079 OSG_DRAWABLE_DLLMAPPING
00080 void calcVertexTexCoords (GeometryPtr geo,
00081 UInt32 texIndex = 0);
00082
00083 OSG_DRAWABLE_DLLMAPPING
00084 Int32 setIndexFromVRMLData ( GeometryPtrArg geo,
00085 std::vector<Int32> &coordIndex,
00086 std::vector<Int32> &normalIndex,
00087 std::vector<Int32> &colorIndex,
00088 std::vector<Int32> &texCoordIndex,
00089 bool convex = true,
00090 bool ccw = true,
00091 bool normalPerVertex = true,
00092 bool colorPerVertex = true,
00093 bool createNormal = true,
00094 bool faceSet = true);
00095
00096 OSG_DRAWABLE_DLLMAPPING
00097 Int32 setIndexFromIndexedX3DData ( GeometryPtr geo,
00098 std::vector<Int32> &coordIndex,
00099 std::vector<Int32> &normalIndex,
00100 std::vector<Int32> &colorIndex,
00101 std::vector<Int32> &texCoordIndex,
00102 Int32 primitiveType =
00103 GL_POLYGON,
00104 bool convex = true,
00105 bool ccw = true,
00106 bool normalPerVertex = true,
00107 bool colorPerVertex = true,
00108 bool createNormal = true);
00109
00110
00111 OSG_DRAWABLE_DLLMAPPING
00112 Int32 createOptimizedPrimitives(GeometryPtrArg geo,
00113 UInt32 iteration = 1,
00114 bool createStrips = true,
00115 bool createFans = true,
00116 UInt32 minFanEdgeCount = 8,
00117 bool colorCode = false,
00118 bool stitchStrips = false);
00119
00120 OSG_DRAWABLE_DLLMAPPING
00121 void createConvexPrimitives (GeometryPtrArg geo);
00122
00123 OSG_DRAWABLE_DLLMAPPING
00124 Int32 createSharedIndex (GeometryPtrArg geo);
00125
00126 OSG_DRAWABLE_DLLMAPPING
00127 Int32 createSingleIndex (GeometryPtrArg geo);
00128
00129 OSG_DRAWABLE_DLLMAPPING
00130 UInt32 calcPrimitiveCount (GeometryPtrArg geo,
00131 UInt32 &triangle,
00132 UInt32 &line,
00133 UInt32 &point);
00134
00135 OSG_DRAWABLE_DLLMAPPING
00136 NodePtr calcVertexNormalsGeo (GeometryPtrArg geo,
00137 Real32 length);
00138
00139 OSG_DRAWABLE_DLLMAPPING
00140 NodePtr calcFaceNormalsGeo (GeometryPtrArg geo,
00141 Real32 length);
00142
00143 OSG_DRAWABLE_DLLMAPPING
00144 void separateProperties (GeometryPtrArg geo);
00145
00146
00147 OSG_DRAWABLE_DLLMAPPING
00148 void mergeGeometries (std::vector<NodePtr> &nodes,
00149 std::vector<NodePtr> &results);
00150
00151 OSG_END_NAMESPACE
00152
00153 #include "OSGGeoFunctions.inl"
00154
00155 #endif