Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
Point.h
Go to the documentation of this file.
1//! @file Point.h
2//! @brief CPt class is the base class for different class of points (C3DPoint, CUVWPoint...)
3//////////////////////////////////////////////////////////////////////
4
5#if !defined(AFX_POINT_H__E9597161_87C0_11D3_A029_C00DB92E437A__INCLUDED_)
6#define AFX_POINT_H__E9597161_87C0_11D3_A029_C00DB92E437A__INCLUDED_
7
8#ifdef _MSC_VER
9#pragma once
10#endif // _MSC_VER
11
12#include "4DPoint.h"
13
14BEGIN_MOOTOOLS_NAMESPACE
15
16//! @enum POINT_PROPERTIES
17//! @brief Point flags used by any classes that inherit from CPt (C3DPoint, C3DVector...)
18typedef enum POINT_PROPERTIES XEnumType(unsigned int)
19{
20 POINT_NONE = 0x00,
21 POINT_IS_SELECTED = 0x01,
22 POINT_IS_INVALID = 0x02, //!< Make the point being deleted during clean operation
23 POINT_IS_UNUSED = 0x04, //!< Make the point being ignored (invalid value)
24 POINT_IS_SPECIFIED_NORMAL = 0x08, //!< Only for normals in SpecNormalChannel. This is a normal which value is computed using the face's normal connected to this point (cf. Autodesk 3ds Max > Edit Normals Modifier, which explains type of normals). If this flag is not set, then the normal is explicit (edited by the user). Mainly used during a 3ds Max Data Exchange.
25
26 POINT_BELONG_TO_BORDER = 0x10, //!< The point belongs to an edge which a border edge (belonging to a single face)
27 POINT_CONNECTED_TO_EDGE_NOT_AT_BORDER = 0x20, //!< The point belongs to an edge which belongs to several faces
28 POINT_CONNECTED_TO_POINT_AT_BORDER = 0x40, //!< The point is connected to a point which is at the border (but the point itself is not at the border)
29 POINT_IS_CONFUSED = 0x80, //!< The point is confused with one or several other points
30 POINT_IS_3D_CORNER = 0x100, //!< The point is set on a 3D corner
31 POINT_IS_2D_CORNER = 0x200, //!< The point is set on a 2D corner
32
33 //! These flags reports breaks that might exists in channels
34 //! They are both set in the channel points and in the geometry points
35 //! ie. : POINT_SPECNORMAL_BREAK is set for a given point when two specified normals (from CSpecNormalChannel) that belong to
36 //! a same point make an angle above a given threshold.
37 POINT_UV_BREAK = 0x1000, //!< Used by points and uvwpoints
38 POINT_VC_BREAK = 0x2000, //!< Used by points and vcpoints
39 POINT_SPECNORMAL_BREAK = 0x4000, //!< A normal break exists belong an edge or belongs a point (when several normals belongs to a point) (this flag refer to CSpecNormalChannel normals)
40 POINT_POINTNORMAL_BREAK = 0x8000, //!< Two or more faces make a normal angle above the smoothing threshold (this flag refer to CPointNormalChannel normals)
41 POINT_UV_CORNER = 0x10000,
42 POINT_SHARE_COPLANAR_FACES = 0x20000, //!< Set if all faces connected to a point are coplanars (set through InitShareCoplanarFacesFlag).
43 POINT_SHARE_SEVERAL_MATERIALS = 0x40000, //!< Set if a point share several materials (set through InitShareSeveralMaterialsFlag)
44 POINT_UV_SYMMETRY = 0x80000, //!< Used by uvwpoints and potentially by points (cf InitUVSymmetryFlag)
45
46 POINT_USER_SELECTED = 0x100000, //!< Flag used for interacting with point list. This is a helper to keep POINT_IS_SELECTED flags is interaction canceled.
47
48 POINT_USER_PROPERTIES1 = 0x01000000,
49 POINT_USER_PROPERTIES2 = 0x02000000,
50 POINT_USER_PROPERTIES3 = 0x04000000,
51 POINT_USER_PROPERTIES4 = 0x08000000,
53
54class C4DPoint;
55
56//! @class CPt
57//! @brief CPt base only contains some flags that are used by the derived class.
58//! @details CPointList is a list of several CPt
59class DLL_3DFUNCTION CPt
60{
61protected:
62 unsigned int flags;
63
64public:
65 CPt();
66 virtual ~CPt(); // Destructor claimed by unreal
67
68
69 // Flags informations
70 unsigned int GetFlags() const;
71 void SetFlags(unsigned int flags);
72 void SetFlag(POINT_PROPERTIES flag, bool set);
73 void SetFlags(unsigned int flags, bool set);
74 bool IsFlagSet(POINT_PROPERTIES flag) const;
75 bool IsOneFlagSet(int flag) const;
76
77 virtual void To4DPoint(C4DPoint& pt) const = 0;
78 virtual CPt& operator=(const C4DPoint&) = 0;
79
80 virtual void Serialize(CXArchive& ar);
81
82 virtual CPt& operator=(const CPt& refpoint);
83
84#ifdef _DEBUG
85 virtual void Dump() const;
86 virtual bool IsKindOf(unsigned int classid) const;
87 virtual unsigned int ClassID() const;
88#endif
89};
90
91#if !defined(__WINDOWS__) || (_MSC_VER > 1600) // DelayLoad problem under VS2010
92inline CPt::~CPt()
93{
94}
95#endif
96
97inline CPt::CPt()
98{
99 flags = POINT_NONE;
100}
101
102inline CPt& CPt::operator=(const CPt& refpoint)
103{
104 flags = refpoint.flags;
105 return *this;
106}
107
108inline void CPt::SetFlag(POINT_PROPERTIES flag, bool set)
109{
110 if (set)
111 flags |= flag;
112 else
113 flags &= ~flag;
114}
115
116inline void CPt::SetFlags(unsigned int newflags, bool set)
117{
118 if (set)
119 flags |= newflags;
120 else
121 flags &= ~newflags;
122}
123
124inline bool CPt::IsFlagSet(POINT_PROPERTIES flag) const
125{
126 return ((flags & flag) == flag) ? true : false;
127}
128
129inline bool CPt::IsOneFlagSet(int flag) const
130{
131 return (flags & flag) ? true : false;
132}
133
134inline unsigned int CPt::GetFlags() const
135{
136 return flags;
137}
138
139inline void CPt::SetFlags(unsigned int refflags)
140{
141 this->flags = refflags;
142}
143
144END_MOOTOOLS_NAMESPACE
145
146#endif // !defined(AFX_POINT_H__E9597161_87C0_11D3_A029_C00DB92E437A__INCLUDED_)
POINT_PROPERTIES
Point flags used by any classes that inherit from CPt (C3DPoint, C3DVector...)
Definition Point.h:19
@ POINT_POINTNORMAL_BREAK
Two or more faces make a normal angle above the smoothing threshold (this flag refer to CPointNormalC...
Definition Point.h:40
@ POINT_IS_CONFUSED
The point is confused with one or several other points.
Definition Point.h:29
@ POINT_UV_SYMMETRY
Used by uvwpoints and potentially by points (cf InitUVSymmetryFlag)
Definition Point.h:44
@ POINT_IS_SPECIFIED_NORMAL
Only for normals in SpecNormalChannel. This is a normal which value is computed using the face's norm...
Definition Point.h:24
@ POINT_IS_INVALID
Make the point being deleted during clean operation.
Definition Point.h:22
@ POINT_IS_2D_CORNER
The point is set on a 2D corner.
Definition Point.h:31
@ POINT_IS_3D_CORNER
The point is set on a 3D corner.
Definition Point.h:30
@ POINT_SHARE_SEVERAL_MATERIALS
Set if a point share several materials (set through InitShareSeveralMaterialsFlag)
Definition Point.h:43
@ POINT_USER_SELECTED
Flag used for interacting with point list. This is a helper to keep POINT_IS_SELECTED flags is intera...
Definition Point.h:46
@ POINT_CONNECTED_TO_POINT_AT_BORDER
The point is connected to a point which is at the border (but the point itself is not at the border)
Definition Point.h:28
@ POINT_CONNECTED_TO_EDGE_NOT_AT_BORDER
The point belongs to an edge which belongs to several faces.
Definition Point.h:27
@ POINT_VC_BREAK
Used by points and vcpoints.
Definition Point.h:38
@ POINT_IS_UNUSED
Make the point being ignored (invalid value)
Definition Point.h:23
@ POINT_UV_BREAK
Used by points and uvwpoints.
Definition Point.h:37
@ POINT_BELONG_TO_BORDER
The point belongs to an edge which a border edge (belonging to a single face)
Definition Point.h:26
@ POINT_SHARE_COPLANAR_FACES
Set if all faces connected to a point are coplanars (set through InitShareCoplanarFacesFlag).
Definition Point.h:42
@ POINT_SPECNORMAL_BREAK
A normal break exists belong an edge or belongs a point (when several normals belongs to a point) (th...
Definition Point.h:39
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
Definition 4DPoint.h:17
CPt base only contains some flags that are used by the derived class.
Definition Point.h:60
Definition XArchive.h:17