This class is an interface used to store user-specified normals
(such as those created in the Edit Normals modifier).
These normals have very limited pipeline support. They are used
for viewport display, but not for rendering.
The
MeshNormalSpec contains three types of normals:
- Unspecified - these are the usual normals that are computed
from smoothing groups. All normals are unspecified by default.
- Specified - these are normals that are intended for use by
particular corners of particular faces, without regard to smoothing
groups. For instance, you can create a box, apply Edit Normals,
select a group of normals at a particular vertex, and click
"Unify". Now those three faces are told to specifically use that
one unified normal, and they ignore their smoothing groups at that
vertex (which would normally tell them they should each have their
own normal).
- Explicit - these are normals that are set to particular values.
For instance, if the user wants to use the Edit Normals Move or
Rotate commands to set a normal to something other than its default
value, it has to be made explicit, so it won't be recomputed based
on the face normals. All explicit normals are also considered to be
specified..
Public Member Functions
|
|
MeshNormalSpec
() |
|
~MeshNormalSpec
() |
void |
SetFlag
(DWORD fl, bool val=true) |
|
Sets flags in the
MeshNormalSpec.
|
void |
ClearFlag
(DWORD fl) |
|
Clears the flags given. See GetFlag for more
details on
MeshNormalSpec flags.
|
bool |
GetFlag
(DWORD fl) const |
|
Gets flags in the
MeshNormalSpec.
|
DllExport
void |
Initialize
() |
|
Initializes all data members - do not use if
already allocated!
|
DllExport
bool |
NAlloc
(int num, bool keep=TRUE) |
DllExport
void |
NShrink
() |
|
shrinks allocation down to actual number of
normals.
|
DllExport
bool |
FAlloc
(int num, bool keep=TRUE) |
DllExport
void |
FShrink
() |
DllExport
void |
Clear
() |
|
Deletes everything.
|
DllExport
void |
ClearAndFree
() |
|
Deletes everything, frees all memory.
|
int |
GetNumFaces
() const |
DllExport
bool |
SetNumFaces
(int numFaces) |
int |
GetNumNormals
() const |
DllExport
bool |
SetNumNormals
(int numNormals) |
Point3 & |
Normal
(int normID) const |
Point3 * |
GetNormalArray
() const |
bool |
GetNormalExplicit
(int normID) const |
void |
SetNormalExplicit
(int normID, bool value) |
void |
SetAllExplicit
(bool value=true) |
|
Set all normals to be explicit.
|
MeshNormalFace
& |
Face
(int faceID) const |
MeshNormalFace * |
GetFaceArray
() const |
void |
SetParent
(Mesh *pMesh) |
DllExport
Point3 & |
GetNormal
(int face, int corner) |
DllExport
void |
SetNormal
(int face, int corner, Point3 &normal) |
DllExport
int |
GetNormalIndex
(int face, int corner) |
DllExport
void |
SetNormalIndex
(int face, int corner, int normalIndex) |
DllExport
int |
NewNormal
(Point3 normal, bool
explic=true) |
DllExport
void |
SetSelection
(BitArray
&newSelection) |
BitArray & |
GetSelection
() |
void |
SetDisplayLength
(float displayLength) |
float |
GetDisplayLength
() |
DllExport
void |
Display
(GraphicsWindow
*gw, bool showSel) |
DllExport
bool |
HitTest
(GraphicsWindow
*gw, HitRegion *hr,
DWORD flags, SubObjHitList &hitList) |
DllExport
Box3 |
GetBoundingBox
(Matrix3 *tm=NULL, bool
selectedOnly=false) |
DllExport
void |
ClearNormals
() |
|
This method dumps all unspecified normals.
Best to use only from within CheckNormals.
|
DllExport
void |
BuildNormals
() |
|
Fills in the mpSpecNormal data by building
all the unspecified normals, and computing non-explicit ones.
|
DllExport
void |
ComputeNormals
() |
|
This method just recomputes the directions
of non-explicit normals, without rebuilding the normal list.
|
DllExport
void |
CheckNormals
() |
|
This checks our flags and calls
BuildNormals, ComputeNormals as needed.
|
DllExport
MeshNormalSpec
& |
operator=
(const MeshNormalSpec &from) |
DllExport
void |
CopySpecified
(const MeshNormalSpec &from) |
DllExport
MeshNormalSpec
& |
operator+=
(const MeshNormalSpec &from) |
DllExport
void |
MyDebugPrint
(bool printAll=false) |
DllExport
bool |
CheckAllData
(int numParentFaces) |
DllExport
IOResult |
Save
(ISave *isave) |
DllExport
IOResult |
Load
(ILoad *iload) |
Interface_ID |
GetID
() |
DllExport
void |
DeleteInterface
() |
DllExport
BaseInterface
* |
GetInterface
(Interface_ID
id) |
DllExport
BaseInterface
* |
CloneInterface
(void *remapDir=NULL) |
DllExport
void |
ShallowCopy
(IPipelineClient *from,
ChannelMask channels) |
DllExport
void |
DeepCopy
(IPipelineClient *from,
ChannelMask channels) |
DllExport
void |
NewAndCopyChannels
(ChannelMask channels) |
DllExport
void |
FreeChannels
(ChannelMask channels, int zeroOthers=1) |
DllExport
void |
ZeroChannels
(ChannelMask channels) |
DllExport
void |
AppendAllChannels
(IPipelineClient *from) |
DllExport
bool |
Transform
(Matrix3 &xfm, BOOL
useSel=false, BitArray *normalSelection=NULL) |
DllExport
bool |
Translate
(Point3 &translate,
BOOL useSel=true, BitArray *normalSelection=NULL) |
DllExport
bool |
BreakNormals
(BOOL useSel=true, BitArray *normalSelection=NULL, BOOL
toAverage=false) |
DllExport
bool |
UnifyNormals
(BOOL useSel=true, BitArray *normalSelection=NULL, BOOL
toAverage=false) |
DllExport
bool |
AverageNormals
(BOOL useThresh=false, float threshold=0.0f, BOOL useSel=true,
BitArray *normalSelection=NULL) |
DllExport
bool |
SpecifyNormals
(BOOL useSel=true, BitArray *normalSelection=NULL) |
DllExport
bool |
MakeNormalsExplicit
(BOOL useSel=true, BitArray *normalSelection=NULL, bool
value=true) |
DllExport
bool |
ResetNormals
(BOOL useSel=true, BitArray *normalSelection=NULL) |