16#if !defined(OPENNURBS_MESH_INC_) 
   17#define OPENNURBS_MESH_INC_ 
   23#if defined(OPENNURBS_PLUS) 
   37  double Tolerance( 
double relative_tolerance, 
double actual_size );
 
   48  bool operator==(
const ON_Mesh&) 
const;
 
   49  bool operator!=(
const ON_Mesh&) 
const;
 
   65    double min_edge_length = 0.0001
 
   73  void JaggedAndFasterMeshParameters();
 
   80  void SmoothAndSlowerMeshParameters();
 
   87  void DefaultAnalysisMeshParameters();
 
 
  205  void EmergencyDestroy();
 
  207  bool Set( ON::curvature_style,
 
 
  317  bool IsTriangle() 
const;
 
  337  bool IsValid( ) 
const;
 
 
  344  bool IsTriangle() 
const;
 
 
  362#if defined(ON_DLL_TEMPLATE) 
  366#pragma warning( push ) 
  367#pragma warning( disable : 4231 ) 
  373#pragma warning( pop ) 
  384  bool IsValid() 
const;
 
  394  int TopVertexCount() 
const;
 
  398  int TopEdgeCount() 
const;
 
  402  int TopFaceCount() 
const;
 
  480  bool GetTopFaceVertices(
 
  498  bool SortVertexEdges( 
int topvi ) 
const;
 
  510  bool SortVertexEdges() 
const;
 
  523  bool TopVertexIsHidden( 
int topvi ) 
const;
 
  536  bool TopEdgeIsHidden( 
int topei ) 
const;
 
  549  bool TopFaceIsHidden( 
int topfi ) 
const;
 
  587  int* GetIntArray(
int count);
 
  594  void EmergencyDestroy();
 
 
  652  bool AddNgon(
int N, 
const int* vi, 
const int* fi);
 
  659  int NgonCount() 
const;
 
  674  bool ReserveNgonCapacity(
int capacity);
 
  686  unsigned int SizeOf() 
const;
 
 
  735  void SetDefaultSurfaceParameterMappingTag();
 
  738               bool bCompareId = 
true,
 
  739               bool bCompareCRC = 
true,
 
  740               bool bCompareXform = 
true 
  755  bool IsDefaultSurfaceParameterMapping() 
const;
 
 
  782#if defined(ON_DLL_TEMPLATE) 
  786#pragma warning( push ) 
  787#pragma warning( disable : 4231 ) 
  790#pragma warning( pop ) 
  810  void MemoryRelocate();
 
  813  void DestroyRuntimeCache( 
bool bDelete = 
true );
 
  816  void EmergencyDestroy(); 
 
  827  void DestroyTree( 
bool bDeleteTree = 
true );
 
  833  unsigned int SizeOf() 
const;
 
  865  ON::object_type ObjectType() 
const;
 
  894        bool GetTightBoundingBox( 
 
  896      int bGrowBox = 
false,
 
  905  bool IsDeformable() 
const;
 
  908  bool MakeDeformable();
 
  918  bool IsMorphable() 
const;
 
  937  bool SetVertexNormal(
 
  941  bool SetVertexNormal(
 
  945  bool SetTextureCoord(
 
 1008      ON_COMPONENT_INDEX ci
 
 1012  int VertexCount() 
const;
 
 1013  int FaceCount() 
const;
 
 1014  int QuadCount() 
const; 
 
 1015  int TriangleCount() 
const; 
 
 1016  bool HasVertexNormals() 
const; 
 
 1017  bool HasFaceNormals() 
const;
 
 1018  bool HasTextureCoordinates() 
const;
 
 1019  bool HasSurfaceParameters() 
const;
 
 1020  bool HasPrincipalCurvatures() 
const;
 
 1021  bool HasVertexColors() 
const;
 
 1027  int HiddenVertexCount() 
const;
 
 1029  bool GetCurvatureStats( 
 
 1030         ON::curvature_style, 
 
 1034  void InvalidateVertexBoundingBox(); 
 
 1036  void InvalidateVertexNormalBoundingBox(); 
 
 1038  void InvalidateTextureCoordinateBoundingBox(); 
 
 1040  void InvalidateCurvatureStats(); 
 
 1042  void InvalidateBoundingBoxes(); 
 
 1047  void FlipVertexNormals(); 
 
 1048  void FlipFaceNormals(); 
 
 1049  void FlipFaceOrientation(); 
 
 1053  void DeleteMeshParameters();
 
 1056  bool UnitizeVertexNormals();
 
 1057  bool UnitizeFaceNormals();
 
 1064  bool ConvertQuadsToTriangles();
 
 1081  bool ConvertTrianglesToQuads(
 
 1082    double angle_tol_radians,
 
 1083    double min_diagonal_length_ratio
 
 1086  bool ComputeFaceNormals();   
 
 1087  bool ComputeFaceNormal(
int); 
 
 1089  int CullDegenerateFaces(); 
 
 1090  int CullUnusedVertices(); 
 
 1097  bool ComputeVertexNormals();    
 
 1102  bool NormalizeTextureCoordinates();
 
 1109        bool TransposeTextureCoordinates();
 
 1110        bool TransposeSurfaceParameters();
 
 1120        bool ReverseTextureCoordinates( 
int dir );
 
 1121        bool ReverseSurfaceParameters( 
int dir );
 
 1142  bool SetTextureCoordinates( 
 
 1144                                        const class ON_Xform* mesh_xform = 0,
 
 1148  bool HasCachedTextureCoordinates() 
const;
 
 1156                                        const class ON_Xform* mesh_xform = 0,
 
 1160  bool EvaluateMeshGeometry( 
const ON_Surface& ); 
 
 1164  bool CombineCoincidentVertices( 
 
 1185  bool CombineIdenticalVertices(
 
 1186          bool bIgnoreVertexNormals = 
false,
 
 1187          bool bIgnoreTextureCoordinates = 
false 
 1190  void Append( 
const ON_Mesh& ); 
 
 1193  void SetClosed(
int);
 
 1199  bool IsClosed() 
const;
 
 1223    bool bTopologicalTest,
 
 1224    bool* pbIsOriented = 
NULL,
 
 1225    bool* pbHasBoundary = 
NULL 
 1256    const int* vertex_index, 
 
 1276#if defined(OPENNURBS_PLUS) 
 1294  bool GetClosestPoint(
 
 1297          double maximum_distance = 0.0
 
 1340          double intersection_tolerance = 0.0,
 
 1341          double overlap_tolerance = 0.0
 
 1362  double Area( 
double* error_estimate = 
NULL ) 
const;
 
 1391  bool AreaMassProperties(
 
 1394    bool bFirstMoments = 
true,
 
 1395    bool bSecondMoments = 
true,
 
 1396    bool bProductMoments = 
true 
 1432              double* error_estimate = 
NULL  
 1451          double* volume = 
NULL 
 1497  bool VolumeMassProperties(
 
 1499    bool bVolume = 
true,
 
 1500    bool bFirstMoments = 
true,
 
 1501    bool bSecondMoments = 
true,
 
 1502    bool bProductMoments = 
true,
 
 1520  bool CollapseEdge( 
int topei );
 
 1533  bool IsSwappableEdge( 
int topei );
 
 1547  bool SwapEdge( 
int topei );
 
 1562  bool DeleteFace( 
int meshfi );
 
 1568  void DestroyHiddenVertexArray();
 
 1577  const bool* HiddenVertexArray() 
const;
 
 1586  void SetVertexHiddenFlag( 
int meshvi, 
bool bHidden );
 
 1597  bool VertexIsHidden( 
int meshvi ) 
const;
 
 1611  bool FaceIsHidden( 
int meshvi ) 
const;
 
 1632  void DestroyTopology();
 
 1648  void DestroyPartition();
 
 1702  void DestroyNgonList();
 
 1785  double m_srf_scale[2];
 
 1835  bool HasPackedTextureRegion() 
const;
 
 1903  bool SwapEdge_Helper( 
int, 
bool );
 
 
 1936  ON_COMPONENT_INDEX ComponentIndex() 
const;
 
 1964  unsigned int SizeOf() 
const;
 
 1965  ON::object_type ObjectType() 
const;
 
 1972         int bGrowBox = 
false 
 
 2001  ON_COMPONENT_INDEX ComponentIndex() 
const;
 
 2029  unsigned int SizeOf() 
const;
 
 2030  ON::object_type ObjectType() 
const;
 
 2037         int bGrowBox = 
false 
 
 2066  ON_COMPONENT_INDEX ComponentIndex() 
const;
 
 2092  unsigned int SizeOf() 
const;
 
 2093  ON::object_type ObjectType() 
const;
 
 2100         int bGrowBox = 
false 
 
 2125            int mesh_density = 0,
 
 2183        double* a, 
double* b, 
double* c
 
 2217          double* a, 
double* b, 
double* c
 
 2344          const double* point,
 
 2348          const int* edge_side,
 
Base class for all dimensioning tools.
Definition Dimension.js:18
Definition opennurbs_array.h:353
Definition opennurbs_array.h:376
Definition opennurbs_point.h:403
Definition opennurbs_point.h:931
Definition opennurbs_array.h:602
Definition opennurbs_fpoint.h:172
Definition opennurbs_array.h:727
Definition opennurbs_fpoint.h:623
Definition opennurbs_archive.h:152
Definition opennurbs_bounding_box.h:25
Definition opennurbs_array.h:760
Definition opennurbs_geometry.h:36
Definition opennurbs_point.h:46
Definition opennurbs_line.h:20
Definition opennurbs_mesh.h:720
ON_TextureMapping::TYPE m_mapping_type
Definition opennurbs_mesh.h:766
ON_Xform m_mesh_xform
Definition opennurbs_mesh.h:768
ON__UINT32 m_mapping_crc
Definition opennurbs_mesh.h:767
ON_UUID m_mapping_id
Definition opennurbs_mesh.h:765
Definition opennurbs_massprop.h:25
Definition opennurbs_mesh.h:197
ON::curvature_style m_style
Definition opennurbs_mesh.h:217
double m_infinity
Definition opennurbs_mesh.h:219
int m_count
Definition opennurbs_mesh.h:222
ON_Interval m_range
Definition opennurbs_mesh.h:227
double m_adev
Definition opennurbs_mesh.h:225
double m_mode
Definition opennurbs_mesh.h:223
double m_average
Definition opennurbs_mesh.h:224
int m_count_infinite
Definition opennurbs_mesh.h:221
Definition opennurbs_mesh.h:1980
const ON_Mesh * m_mesh
Definition opennurbs_mesh.h:1988
int m_top_ei
Definition opennurbs_mesh.h:1991
ON_OBJECT_DECLARE(ON_MeshEdgeRef)
Definition opennurbs_mesh.h:341
Definition opennurbs_mesh.h:2045
int m_mesh_fi
Definition opennurbs_mesh.h:2056
ON_OBJECT_DECLARE(ON_MeshFaceRef)
const ON_Mesh * m_mesh
Definition opennurbs_mesh.h:2053
Definition opennurbs_mesh.h:795
ON_SimpleArray< ON_MeshFace > m_F
Definition opennurbs_mesh.h:1716
int m_closed
Definition opennurbs_mesh.h:1882
int m_triangle_count
Definition opennurbs_mesh.h:1880
int m_quad_count
Definition opennurbs_mesh.h:1879
int m_invalid_count
Definition opennurbs_mesh.h:1878
ON_ClassArray< ON_TextureCoordinates > m_TC
Definition opennurbs_mesh.h:1748
ON_SimpleArray< bool > m_H
Definition opennurbs_mesh.h:1855
friend class ON_MeshEdgeRef
Definition opennurbs_mesh.h:1868
ON_SimpleArray< ON_Color > m_C
Definition opennurbs_mesh.h:1848
int m_hidden_count
Definition opennurbs_mesh.h:1859
ON_MappingTag m_Ttag
Definition opennurbs_mesh.h:1738
ON_3fVectorArray m_FN
Definition opennurbs_mesh.h:1728
ON_MeshPartition * m_partition
Definition opennurbs_mesh.h:1892
ON_3fPointArray m_V
Definition opennurbs_mesh.h:1713
ON_MeshTopology m_top
Definition opennurbs_mesh.h:1874
const ON_Object * m_parent
Definition opennurbs_mesh.h:1864
bool m_packed_tex_rotate
Definition opennurbs_mesh.h:1825
ON_SimpleArray< ON_SurfaceCurvature > m_K
Definition opennurbs_mesh.h:1840
ON_OBJECT_DECLARE(ON_Mesh)
ON_MappingTag m_Ctag
Definition opennurbs_mesh.h:1847
friend class ON_MeshFaceRef
Definition opennurbs_mesh.h:1869
ON_MeshParameters * m_mesh_parameters
Definition opennurbs_mesh.h:1876
const class ON_MeshTree * MeshTree() const
class ON_MeshTree * m_mtree
Definition opennurbs_mesh.h:1894
ON_2dPointArray m_S
Definition opennurbs_mesh.h:1783
ON_3fVectorArray m_N
Definition opennurbs_mesh.h:1722
ON_2fPointArray m_T
Definition opennurbs_mesh.h:1739
friend class ON_MeshVertexRef
Definition opennurbs_mesh.h:1867
Definition opennurbs_mesh.h:631
ON_MeshNgon * m_ngons
Definition opennurbs_mesh.h:691
int m_ngons_count
Definition opennurbs_mesh.h:689
struct ON_NGON_MEMBLK * m_memblk_list
Definition opennurbs_mesh.h:692
int m_ngons_capacity
Definition opennurbs_mesh.h:690
Definition opennurbs_mesh.h:33
double m_relative_tolerance
Definition opennurbs_mesh.h:154
unsigned char m_mesher
Definition opennurbs_mesh.h:130
double m_min_tolerance
Definition opennurbs_mesh.h:155
bool m_bJaggedSeams
Definition opennurbs_mesh.h:121
double m_min_edge_length
Definition opennurbs_mesh.h:163
double m_tolerance
Definition opennurbs_mesh.h:151
double m_grid_angle
Definition opennurbs_mesh.h:177
bool m_bComputeCurvature
Definition opennurbs_mesh.h:109
int m_grid_max_count
Definition opennurbs_mesh.h:176
int m_texture_range
Definition opennurbs_mesh.h:132
double m_grid_aspect_ratio
Definition opennurbs_mesh.h:172
unsigned char m_reserved2
Definition opennurbs_mesh.h:129
bool m_bRefine
Definition opennurbs_mesh.h:118
int m_face_type
Definition opennurbs_mesh.h:191
double m_refine_angle
Definition opennurbs_mesh.h:187
bool m_bSimplePlanes
Definition opennurbs_mesh.h:112
double m_grid_amplification
Definition opennurbs_mesh.h:180
bool m_bCustomSettings
Definition opennurbs_mesh.h:101
unsigned char m_reserved1
Definition opennurbs_mesh.h:128
int m_grid_min_count
Definition opennurbs_mesh.h:175
double m_max_edge_length
Definition opennurbs_mesh.h:167
Definition opennurbs_mesh.h:696
int m_partition_max_vertex_count
Definition opennurbs_mesh.h:702
ON_SimpleArray< struct ON_MeshPart > m_part
Definition opennurbs_mesh.h:714
int m_partition_max_triangle_count
Definition opennurbs_mesh.h:704
Definition opennurbs_mesh.h:377
friend class ON_Mesh
Definition opennurbs_mesh.h:590
ON_MeshTopology & operator=(const ON_MeshTopology &)
bool m_bIsValid
Definition opennurbs_mesh.h:601
ON_SimpleArray< int > m_topv_map
Definition opennurbs_mesh.h:555
ON_SimpleArray< ON_MeshTopologyEdge > m_tope
Definition opennurbs_mesh.h:565
ON_MeshTopology(const ON_MeshTopology &)
ON_SimpleArray< ON_MeshTopologyVertex > m_topv
Definition opennurbs_mesh.h:560
const ON_Mesh * m_mesh
Definition opennurbs_mesh.h:390
ON_SimpleArray< ON_MeshTopologyFace > m_topf
Definition opennurbs_mesh.h:574
Definition opennurbs_mesh.h:1907
const ON_Mesh * m_mesh
Definition opennurbs_mesh.h:1916
int m_mesh_vi
Definition opennurbs_mesh.h:1920
ON_OBJECT_DECLARE(ON_MeshVertexRef)
int m_top_vi
Definition opennurbs_mesh.h:1923
Definition opennurbs_nurbssurface.h:62
Definition opennurbs_objref.h:167
Definition opennurbs_object.h:393
Definition opennurbs_array.h:46
Definition opennurbs_xform.h:1146
Definition opennurbs_point.h:1533
Definition opennurbs_surface.h:58
Definition opennurbs_textlog.h:20
Definition opennurbs_mesh.h:772
ON_MappingTag m_tag
Definition opennurbs_mesh.h:776
int m_dim
Definition opennurbs_mesh.h:777
ON_SimpleArray< ON_3fPoint > m_T
Definition opennurbs_mesh.h:778
Definition opennurbs_texture_mapping.h:37
TYPE
Definition opennurbs_texture_mapping.h:592
Definition opennurbs_uuid.h:31
#define ON_DECL
Definition opennurbs_defines.h:92
#define ON_CLASS
Definition opennurbs_defines.h:91
ON_DECL ON_Mesh * ON_ControlPolygonMesh(const ON_NurbsSurface &nurbs_surface, bool bCleanMesh, ON_Mesh *input_mesh=NULL)
Definition opennurbs_mesh_tools.cpp:693
ON_DECL ON_3dVector ON_TriangleNormal(const ON_3dPoint &A, const ON_3dPoint &B, const ON_3dPoint &C)
Definition opennurbs_mesh.cpp:8101
ON_DECL ON_Mesh * ON_MeshSurface(const ON_Surface &surface, int mesh_density=0, ON_Mesh *mesh=0)
Definition opennurbs_mesh.cpp:329
ON_DECL int ON_Mesh2dRegion(int point_count, int point_stride, const double *point, int edge_count, int edge_stride, const int *edge, const int *edge_side, ON_SimpleArray< ON_3dex > &triangles)
Definition opennurbs_mesh.cpp:8595
ON_DECL bool ON_ClosestPointToTriangleFast(const ON_3dPoint &A, const ON_3dPoint &B, const ON_3dPoint &C, ON_3dPoint P, double *a, double *b, double *c)
Definition opennurbs_mesh.cpp:8041
ON_DECL bool ON_Mesh2dPolygon(int point_count, int point_stride, const double *P, int tri_stride, int *triangle)
ON_DECL int ON_LineTriangleIntersect(const ON_3dPoint &A, const ON_3dPoint &B, const ON_3dPoint &C, const ON_3dPoint &P, const ON_3dPoint &Q, double abc[2][3], double t[2], double tol)
Definition opennurbs_mesh.cpp:8174
ON_DECL bool ON_ClosestPointToTriangle(ON_3dPoint A, ON_3dPoint B, ON_3dPoint C, ON_3dPoint P, double *a, double *b, double *c)
Definition opennurbs_mesh.cpp:7988
const ON_3dPoint ON_origin(0.0, 0.0, 0.0)
const ON_3dPoint ON_UNSET_POINT(ON_UNSET_VALUE, ON_UNSET_VALUE, ON_UNSET_VALUE)
#define N
Definition opennurbs_rand.cpp:70
#define NULL
Definition opennurbs_system.h:256
int ON_BOOL32
Definition opennurbs_system.h:362
unsigned int ON__UINT32
Definition opennurbs_system.h:326
Definition opennurbs_mesh.h:610
int * vi
Definition opennurbs_mesh.h:619
int N
Definition opennurbs_mesh.h:612
int * fi
Definition opennurbs_mesh.h:627
Definition opennurbs_mesh.h:353
int vertex_count
Definition opennurbs_mesh.h:358
int vi[2]
Definition opennurbs_mesh.h:356
int triangle_count
Definition opennurbs_mesh.h:359
int fi[2]
Definition opennurbs_mesh.h:357
Definition opennurbs_mesh.h:598
struct memchunk * next
Definition opennurbs_mesh.h:599
Definition opennurbs_mesh.h:258
int m_topvi[2]
Definition opennurbs_mesh.h:261
const int * m_topfi
Definition opennurbs_mesh.h:268
int m_topf_count
Definition opennurbs_mesh.h:264
Definition opennurbs_mesh.h:272
Definition opennurbs_mesh.h:236
const int * m_vi
Definition opennurbs_mesh.h:254
const int * m_topei
Definition opennurbs_mesh.h:246
int m_tope_count
Definition opennurbs_mesh.h:239
int m_v_count
Definition opennurbs_mesh.h:250
Definition opennurbs_mesh_ngon.cpp:15