17 #if !defined(OPENNURBS_MESH_INC_)
18 #define OPENNURBS_MESH_INC_
35 render_mesh_quality = 2,
37 render_mesh_custom = 9,
38 render_mesh_per_object = 10
72 double Tolerance(
double relative_tolerance,
double actual_size );
88 double MinEdgeLength(
double max_edge_length,
double tolerance );
99 bool operator==(
const ON_Mesh&)
const;
100 bool operator!=(
const ON_Mesh&)
const;
116 double min_edge_length = 0.0001
124 void JaggedAndFasterMeshParameters();
131 void SmoothAndSlowerMeshParameters();
138 void DefaultAnalysisMeshParameters();
155 ON__UINT32 DataCRC(ON__UINT32)
const;
220 unsigned int m_reserved2;
269 unsigned int m_reserved3;
281 void EmergencyDestroy();
283 bool Set( ON::curvature_style,
393 bool IsTriangle()
const;
413 bool IsValid( )
const;
427 bool IsTriangle()
const;
454 int mesh_vertex_count
457 int mesh_vertex_count,
461 int mesh_vertex_count,
489 int mesh_vertex_count
492 int mesh_vertex_count,
496 int mesh_vertex_count,
536 void ON_SortMeshFaceSidesByVertexIndex(
551 #if defined(ON_DLL_TEMPLATE)
555 #pragma warning( push )
556 #pragma warning( disable : 4231 )
562 #pragma warning( pop )
573 bool IsValid()
const;
583 int TopVertexCount()
const;
587 int TopEdgeCount()
const;
591 int TopFaceCount()
const;
670 bool GetTopFaceVertices(
688 bool SortVertexEdges(
int topvi )
const;
700 bool SortVertexEdges()
const;
713 bool TopVertexIsHidden(
int topvi )
const;
726 bool TopEdgeIsHidden(
int topei )
const;
739 bool TopFaceIsHidden(
int topfi )
const;
777 int* GetIntArray(
int count);
784 void EmergencyDestroy();
789 struct memchunk* next;
793 volatile int m_b32IsValid;
797 int WaitUntilReady(
int sleep_value)
const;
848 bool AddNgon(
int N,
const int* vi,
const int* fi);
855 int NgonCount()
const;
870 bool ReserveNgonCapacity(
int capacity);
882 unsigned int SizeOf()
const;
886 int m_ngons_capacity;
888 struct ON_NGON_MEMBLK* m_memblk_list;
923 void Transform(
const ON_Xform& xform );
931 void SetDefaultSurfaceParameterMappingTag();
934 bool bCompareId =
true,
935 bool bCompareCRC =
true,
936 bool bCompareXform =
true
951 bool IsDefaultSurfaceParameterMapping()
const;
978 #if defined(ON_DLL_TEMPLATE)
982 #pragma warning( push )
983 #pragma warning( disable : 4231 )
986 #pragma warning( pop )
995 int initial_face_array_capacity,
996 int initial_vertex_array_capacity,
997 bool has_vertex_normals,
998 bool has_texture_coordinates
1005 void MemoryRelocate();
1008 void DestroyRuntimeCache(
bool bDelete =
true );
1011 void EmergencyDestroy();
1020 void DestroyTree(
bool bDeleteTree =
true );
1026 unsigned int SizeOf()
const;
1029 ON__UINT32 DataCRC(ON__UINT32 current_remainder)
const;
1050 ON_BOOL32 IsValid(
ON_TextLog* text_log = NULL )
const;
1058 ON::object_type ObjectType()
const;
1063 int Dimension()
const;
1087 bool GetTightBoundingBox(
1089 int bGrowBox =
false,
1093 ON_BOOL32 Transform(
1098 bool IsDeformable()
const;
1101 bool MakeDeformable();
1103 ON_BOOL32 SwapCoordinates(
1124 bool SetVertexNormal(
1128 bool SetVertexNormal(
1132 bool SetTextureCoord(
1195 ON_COMPONENT_INDEX ci
1199 int VertexCount()
const;
1200 int FaceCount()
const;
1201 int QuadCount()
const;
1202 int TriangleCount()
const;
1203 int InvalidFaceCount()
const;
1204 bool HasVertexNormals()
const;
1205 bool HasFaceNormals()
const;
1206 bool HasTextureCoordinates()
const;
1207 bool HasSurfaceParameters()
const;
1208 bool HasPrincipalCurvatures()
const;
1209 bool HasVertexColors()
const;
1215 int HiddenVertexCount()
const;
1217 bool GetCurvatureStats(
1218 ON::curvature_style,
1222 void InvalidateVertexBoundingBox();
1224 void InvalidateVertexNormalBoundingBox();
1226 void InvalidateTextureCoordinateBoundingBox();
1228 void InvalidateCurvatureStats();
1230 void InvalidateBoundingBoxes();
1235 void FlipVertexNormals();
1236 void FlipFaceNormals();
1237 void FlipFaceOrientation();
1241 void DeleteMeshParameters();
1244 bool UnitizeVertexNormals();
1245 bool UnitizeFaceNormals();
1252 bool ConvertQuadsToTriangles();
1269 bool ConvertTrianglesToQuads(
1270 double angle_tol_radians,
1271 double min_diagonal_length_ratio
1274 bool ComputeFaceNormals();
1275 bool ComputeFaceNormal(
int);
1292 int GetClashingFacePairs(
1318 int CullClashingFaces(
int what_to_cull );
1320 int CullDegenerateFaces();
1322 int CullUnusedVertices();
1329 bool ComputeVertexNormals();
1334 bool NormalizeTextureCoordinates();
1341 bool TransposeTextureCoordinates();
1342 bool TransposeSurfaceParameters();
1352 bool ReverseTextureCoordinates(
int dir );
1353 bool ReverseSurfaceParameters(
int dir );
1374 bool SetTextureCoordinates(
1376 const class ON_Xform* mesh_xform = 0,
1380 bool HasCachedTextureCoordinates()
const;
1388 const class ON_Xform* mesh_xform = 0,
1392 bool EvaluateMeshGeometry(
const ON_Surface& );
1396 bool CombineCoincidentVertices(
1417 bool CombineIdenticalVertices(
1418 bool bIgnoreVertexNormals =
false,
1419 bool bIgnoreTextureCoordinates =
false
1422 void Append(
const ON_Mesh& );
1436 void Append(
int count,
const ON_Mesh*
const* meshes );
1452 void SetClosed(
int closed);
1458 bool IsClosed()
const;
1464 bool IsManifold()
const;
1471 bool IsOriented()
const;
1495 bool bTopologicalTest,
1496 bool* pbIsOriented = NULL,
1497 bool* pbHasBoundary = NULL
1517 void SetSolidOrientation(
int solid_orientation);
1529 int SolidOrientation()
const;
1542 bool IsSolid()
const;
1572 const int* vertex_index,
1619 int* GetVertexLocationIds(
1653 int GetMeshFaceSideList(
1706 int GetMeshEdgeList(
1708 int edge_type_partition[5]
1711 int GetMeshEdgeList(
1714 int edge_type_partition[5]
1717 int GetMeshEdgeList(
1721 int edge_type_partition[5]
1738 bool CollapseEdge(
int topei );
1751 bool IsSwappableEdge(
int topei );
1765 bool SwapEdge(
int topei );
1780 bool DeleteFace(
int meshfi );
1786 void DestroyHiddenVertexArray();
1795 const bool* HiddenVertexArray()
const;
1804 void SetVertexHiddenFlag(
int meshvi,
bool bHidden );
1815 bool VertexIsHidden(
int meshvi )
const;
1829 bool FaceIsHidden(
int meshvi )
const;
1850 void DestroyTopology();
1859 bool TopologyExists()
const;
1876 void DestroyPartition();
1944 void DestroyNgonList();
1978 int GetConnectedComponents(
bool bUseVertexConnections,
1979 bool bTopologicalConnections,
2005 int GetConnectedComponents(
bool bUseVertexConnections,
2006 bool bTopologicalConnections,
2021 bool HasSynchronizedDoubleAndSinglePrecisionVertices()
const;
2039 bool HasDoublePrecisionVertices()
const;
2047 void EnableDoublePrecisionVertices(
bool bEnableDoublePrecisionVertices);
2057 void UpdateSinglePrecisionVertices();
2067 void UpdateDoublePrecisionVertices();
2078 void SetSinglePrecisionVerticesAsValid();
2089 void SetDoublePrecisionVerticesAsValid();
2105 bool SinglePrecisionVerticesAreValid()
const;
2120 bool DoublePrecisionVerticesAreValid()
const;
2126 void DestroyDoublePrecisionVertices();
2273 double m_srf_scale[2];
2323 bool HasPackedTextureRegion()
const;
2371 char m_mesh_is_closed;
2372 char m_mesh_is_manifold;
2373 char m_mesh_is_oriented;
2374 char m_mesh_is_solid;
2394 bool SwapEdge_Helper(
int,
bool );
2427 ON_COMPONENT_INDEX ComponentIndex()
const;
2453 ON_BOOL32 IsValid(
ON_TextLog* text_log = NULL )
const;
2455 unsigned int SizeOf()
const;
2456 ON::object_type ObjectType()
const;
2459 int Dimension()
const;
2463 int bGrowBox =
false
2465 ON_BOOL32 Transform(
2492 ON_COMPONENT_INDEX ComponentIndex()
const;
2518 ON_BOOL32 IsValid(
ON_TextLog* text_log = NULL )
const;
2520 unsigned int SizeOf()
const;
2521 ON::object_type ObjectType()
const;
2524 int Dimension()
const;
2528 int bGrowBox =
false
2530 ON_BOOL32 Transform(
2557 ON_COMPONENT_INDEX ComponentIndex()
const;
2581 ON_BOOL32 IsValid(
ON_TextLog* text_log = NULL )
const;
2583 unsigned int SizeOf()
const;
2584 ON::object_type ObjectType()
const;
2587 int Dimension()
const;
2591 int bGrowBox =
false
2593 ON_BOOL32 Transform(
2613 ON_Mesh* ON_ControlPolygonMesh(
2658 bool ON_GetTrianglePlaneEquation(
2666 double* evaluation_tol
int m_partition_max_vertex_count
double m_grid_amplification
ON_MeshPartition * m_partition
ON_MeshParameters * m_mesh_parameters
ON::curvature_style m_style
ON_SimpleArray< ON_SurfaceCurvature > m_K
ON_ClassArray< ON_TextureCoordinates > m_TC
double m_relative_tolerance
ON_SimpleArray< struct ON_MeshPart > m_part
ON_SimpleArray< ON_MeshTopologyFace > m_topf
ON_SimpleArray< bool > m_H
ON_SimpleArray< ON_MeshTopologyVertex > m_topv
ON_TextureMapping::TYPE m_mapping_type
const ON_Object * m_parent
double m_grid_aspect_ratio
ON_SimpleArray< int > m_topv_map
ON_SimpleArray< ON_3fPoint > m_T
ON_SimpleArray< ON_Color > m_C
ON_SimpleArray< ON_MeshTopologyEdge > m_tope
static const ON_MeshParameters FastRenderMesh
ON_SimpleArray< ON_MeshFace > m_F
int m_partition_max_triangle_count
friend class ON_MeshVertexRef
bool m_bCustomSettingsEnabled
static const ON_MeshParameters QualityRenderMesh
friend class ON_MeshEdgeRef
friend class ON_MeshFaceRef