Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
SpecNormalChannel.h
Go to the documentation of this file.
1//! @file SpecNormalChannel.h
2//! @brief CSpecNormalChannel class for handling the user specified normals
3//!
4//////////////////////////////////////////////////////////////////////
5
6#if !defined(AFX_SPECNORMALCHANNEL_H__79EB93C5_8866_11D3_A029_8FE73A9B677B__INCLUDED_)
7#define AFX_SPECNORMALCHANNEL_H__79EB93C5_8866_11D3_A029_8FE73A9B677B__INCLUDED_
8
9#ifdef _MSC_VER
10#pragma once
11#endif // _MSC_VER
12
13#include "Channel.h"
14
15BEGIN_MOOTOOLS_NAMESPACE
16
17//! @class CSpecNormalChannel
18//! @brief CSpecNormalChannel is the channel class dedicated to user defined or specified normals.
19//! @details CSpecNormalChannel belongs to CDependentChannels and is referenced by the SPEC_NORMAL_CHANNEL identifier.
20class DLL_3DFUNCTION CSpecNormalChannel : public CChannel
21{
22 DECLARE_SERIAL_XOBJECT(CSpecNormalChannel);
23
24public:
25 CSpecNormalChannel(ChannelID id = CHANNELID_UNDEFINED); // If id = CHANNELID_UNDEFINED, the id is automatically assigned when adding the channel to object channels. If id != CHANNELID_UNDEFINED, the id might be modified if it already exists in object channels
26 virtual ~CSpecNormalChannel(); // Use Delete instead, unless the CSpecNormalChannel is created on the stack (take care that it is referenced once only in this case)
27
28 // Normal informations
29 CNormalFaceList *GetNormalFaceList();
30 C3DVectorList *GetNormalVectorList();
31
32 bool MatrixTransform(const C4x4Matrix& refmatrix, POINT_PROPERTIES property = POINT_NONE, bool set = TRUE, int index = 0, int count = -1);
33 bool SwapCoordinates(unsigned int swapMode);
34
35 bool Normalize();
36 bool InverseDir(); // Turn all vectors to opposite dir
37 bool ComputeNormals(const CGeomInfo *info, NormalSmoothMode normalMode = NORMAL_AREAWEIGHTED_MODE); // Return false if nothing changed
38 bool GenerateNormals(const CGeomInfo *info, unsigned int mode, double smoothAngle, NormalSmoothMode normalMode = NORMAL_AREAWEIGHTED_MODE); // Mode is a combination of GENNORMAL_MODE flags (GENNORMAL_PER_VERTEX is implicit). Return true if at least one normal has been computed, false if nothing need to be computed
39 bool IsNormalFrontier(const CGeomInfo *info, double radianThresholdAngle, const C3DEdge& edge, int faceindex1, int faceindex2);
40 void InitNormalBreakFlag(const CGeomInfo *info, double radianThresholdAngle, bool reinitPointFlag, NormalSmoothMode normalMode = NORMAL_AREAWEIGHTED_MODE);
41
42 // Virtuals
43 virtual bool Compare(const CPt *pt1, const CPt *pt2, double tolerance = 0.0f) const;
44
45protected:
46};
47
48END_MOOTOOLS_NAMESPACE
49
50#endif // !defined(AFX_SPECNORMALCHANNEL_H__79EB93C5_8866_11D3_A029_8FE73A9B677B__INCLUDED_)
NormalSmoothMode
Definition 3DType.h:401
@ NORMAL_AREAWEIGHTED_MODE
Definition 3DType.h:405
CChannel class definition which is the base class for object channels (UV, normals....
POINT_PROPERTIES
Point flags used by any classes that inherit from CPt (C3DPoint, C3DVector...)
Definition Point.h:19
C3DEdge is a class containing 2 point indexes that represent the edge of a face.
Definition FaceList.h:72
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
C3DVectorList is an array of C3DVector. It is used in particular by CPointNormalChannel,...
Definition 3DVectorList.h:45
A CChannel is the base class for some additional information associated to an object.
Definition Channel.h:93
virtual bool Compare(const CChannel *channel) const
Return true if the channel have same type and same content.
CGeomInfo is an helper class oftenly required by different methods.
Definition GeomInfo.h:71
CNormalFaceList is a CFaceList that contains CNormalFace. It usually belongs to a by CPointNormalChan...
Definition NormalFaceList.h:21
CPt base only contains some flags that are used by the derived class.
Definition Point.h:60
CSpecNormalChannel is the channel class dedicated to user defined or specified normals.
Definition SpecNormalChannel.h:21