Polygon Crucher SDK - Documentation
Documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
3DVectorList.h
1//! @file VectorList.h
2//! @brief CVectorList is a CFaceList that contains C3DVector
3//!
4//////////////////////////////////////////////////////////////////////
5
6#if !defined(AFX_3DVECTORLIST_H__75A0EE81_16C0_11D4_A382_FAEB806C4E23__INCLUDED_)
7#define AFX_3DVECTORLIST_H__75A0EE81_16C0_11D4_A382_FAEB806C4E23__INCLUDED_
8
9#ifdef _MSC_VER
10#pragma once
11#endif // _MSC_VER
12
13#include "3DVector.h"
14#include "PointList.h"
15
16BEGIN_MOOTOOLS_NAMESPACE
17
18class C3DVectorMethods : public CPointMethods
19{
20 DECLARE_SERIAL_XOBJECT(C3DVectorMethods);
21
22 SIZET GetSizeof() const;
23 ElementType GetType() const;
24 void ConstructElement(void* pNewData);
25};
26
27inline SIZET C3DVectorMethods::GetSizeof() const
28{
29 return sizeof(C3DVector);
30}
31
32inline ElementType C3DVectorMethods::GetType() const
33{
34 return MAKE_CUSTOM_ID('3', 'D', 'V', 'E');
35}
36
37inline void C3DVectorMethods::ConstructElement(void* pNewData)
38{
39 xConstruct(C3DVector, pNewData);
40}
41
42//! @class C3DVectorList
43//! @brief C3DVectorList is an array of C3DVector. It is used in particular by CPointNormalChannel, CFaceNormalChannel and CSpecNormalChannel.
44class DLL_3DFUNCTION C3DVectorList : public CPointList
45{
46 DECLARE_SERIAL_XOBJECT(C3DVectorList);
47
49 virtual ~C3DVectorList(); //!< Use Delete instead, unless the C3DVectorList is created on the stack (take care that it is referenced once only in this case)
50
51 static C3DVectorList *Create(C3DVectorList *srcFaces = NULL); //!< Allocates and creates an empty set of 3d vectot. Use C3DVectorList::Delete to delete it
52
53 //! @name Access functions
54 //! Get access to the C3DVector data contained in the array
55 //!
56 //! @{
57 C3DVector *GetFirst();
58 const C3DVector *GetFirst() const;
60 const C3DVector *GetNext(const C3DVector *uvcoordPtr) const;
61 C3DVector *ElementAt(int i);
62 C3DVector *operator[](int i);
63
64 //! @}
65
66 // C3DVector constructions functions
67 virtual CPointList& operator=(const CPointList& refpoints);
68 bool SwapCoordinates(unsigned int swapMode);
69 bool MatrixTransform(const C4x4Matrix& matrix, POINT_PROPERTIES property = POINT_NONE, bool set = TRUE, int index = 0, int count = -1);
70 void Normalize(); //!< Normalize all vector values
71 void NegateVector(int index); //!< Invert specified vector
72 void NegateVectors(); //!< Turn all vector to opposite direction
73
74 virtual unsigned int GetChecksum(unsigned int checksumFlags = CHECKSUM_POINTS | CHECKSUM_POINTS_EXTRA) const; //!< Return a value that is a simple way to check if the geometry changed between two call to the method
75
76#ifdef _DEBUG
77 virtual void Dump() const;
79#endif
80};
81
82inline C3DVector *C3DVectorList::GetFirst()
83{
84 return (C3DVector *)CElementArray::GetFirst();
85}
86
87inline C3DVector *C3DVectorList::GetNext(C3DVector *uvcoordPtr)
88{
89 return (C3DVector *)CElementArray::GetNext(uvcoordPtr);
90}
91
92inline const C3DVector *C3DVectorList::GetFirst() const
93{
94 return (C3DVector *)CElementArray::GetFirst();
95}
96
97inline const C3DVector *C3DVectorList::GetNext(const C3DVector *uvcoordPtr) const
98{
99 return (C3DVector *)CElementArray::GetNext(uvcoordPtr);
100}
101
102inline C3DVector *C3DVectorList::ElementAt(int i)
103{
104 return ((C3DVector *)CElementArray::ElementAt(i));
105}
106
107inline C3DVector *C3DVectorList::operator[](int i)
108{
109 return ((C3DVector *)CElementArray::operator[](i));
110}
111
112END_MOOTOOLS_NAMESPACE
113
114#endif // !defined(AFX_3DVECTORLIST_H__75A0EE81_16C0_11D4_A382_FAEB806C4E23__INCLUDED_)
@ CHECKSUM_POINTS
Point position is taken into account (geometry and channel if CHECKSUM_CHANNELS set)
Definition 3DType.h:428
@ CHECKSUM_POINTS_EXTRA
Point flags (geometry and channel if CHECKSUM_CHANNELS set)
Definition 3DType.h:429
POINT_PROPERTIES
Point flags used by any classes that inherit from CPt (C3DPoint, C3DVector...)
Definition Point.h:19
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
unsigned int GetChecksum() const
Return a checksum value made by bitwise operator that is a simple way to check if content changed bet...
CPointList is the base class for different classes (C3DPointList, CUVWPointList......
Definition PointList.h:50