Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
VCPoint.h
Go to the documentation of this file.
1//! @file VCPoint.h
2//! @brief CVCPoint is a point that have a color value
3//!// VCPoint.h: interface for the VCPoint class.
4//
5//////////////////////////////////////////////////////////////////////
6
7#if !defined(AFX_VCPOINT_H__350DEEC1_8B26_11D3_A382_E0AAB89E432D__INCLUDED_)
8#define AFX_VCPOINT_H__350DEEC1_8B26_11D3_A382_E0AAB89E432D__INCLUDED_
9
10#ifdef _MSC_VER
11#pragma once
12#endif // _MSC_VER
13
14#include "Point.h"
15#include "3DMaterial.h"
16
17BEGIN_MOOTOOLS_NAMESPACE
18
19//! @class CVCPoint
20//! @brief CVCPoint is a point that have a CRGBColor and which is used for handling object vertex colors.
21class DLL_3DFUNCTION CVCPoint : public CPt
22{
23public:
24 CRGBColor color;
25
26public:
27 CVCPoint();
28
29 // Access operators
30 unsigned char& operator[](int i);
31 const unsigned char& operator[](int i) const;
32 unsigned char* ValPtr();
33
34 CVCPoint& operator=(const CVCPoint& refpoint);
35 bool operator==(const CVCPoint& pt) const;
36
37 virtual CPt& operator=(const CPt& refpoint);
38 virtual void To4DPoint(C4DPoint& pt) const;
39 virtual CPt& operator=(const C4DPoint& pt);
40
41 operator CRGBColor();
42 CRGBColor& GetColor();
43 void SetColor(CRGBColor& color);
44 void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 0);
45 void SetColor(float r, float g, float b, float a, float scale);
46 void SetColor3(const unsigned char *rgb);
47 void SetColor4(const unsigned char *rgba);
48 void SetColor3(const float *rgb, float scale);
49 void SetColor4(const float *rgba, float scale);
50
51 virtual void Serialize(CXArchive& ar);
52
53#ifdef _DEBUG
54 virtual void Dump() const;
55 bool IsKindOf(unsigned int classid) const;
56 virtual unsigned int ClassID() const;
57#endif
58};
59
60inline CVCPoint::CVCPoint()
61{
62}
63
64// Access operators
65inline unsigned char& CVCPoint::operator[](int i)
66{
67 return color[i];
68}
69
70inline const unsigned char& CVCPoint::operator[](int i) const
71{
72 return color[i];
73}
74
75inline unsigned char* CVCPoint::ValPtr()
76{
77 return &color[0];
78}
79
80inline CVCPoint& CVCPoint::operator=(const CVCPoint& refpoint)
81{
82 CPt::operator=(refpoint);
83 color = refpoint.color;
84
85 return *this;
86}
87
88inline bool CVCPoint::operator==(const CVCPoint& pt) const
89{
90 return (color == pt.color);
91}
92
93inline CVCPoint::operator CRGBColor()
94{
95 return color;
96}
97
98inline CRGBColor& CVCPoint::GetColor()
99{
100 return color;
101}
102
103inline void CVCPoint::SetColor(CRGBColor& color)
104{
105 this->color = color;
106}
107
108inline void CVCPoint::SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
109{
110 this->color.SetColor(r, g, b, a);
111}
112
113inline void CVCPoint::SetColor(float r, float g, float b, float a, float scale)
114{
115 this->color.SetColor(r, g, b, a);
116}
117
118inline void CVCPoint::SetColor3(const unsigned char *rgb)
119{
120 this->color.SetColor3(rgb);
121}
122
123inline void CVCPoint::SetColor4(const unsigned char *rgba)
124{
125 this->color.SetColor4(rgba);
126}
127
128inline void CVCPoint::SetColor3(const float *rgb, float scale)
129{
130 this->color.SetColor3(rgb, scale);
131}
132
133inline void CVCPoint::SetColor4(const float *rgba, float scale)
134{
135 this->color.SetColor4(rgba, scale);
136}
137
138END_MOOTOOLS_NAMESPACE
139
140#endif // !defined(AFX_VCPOINT_H__350DEEC1_8B26_11D3_A382_E0AAB89E432D__INCLUDED_)
The files handles materials definition.
CPt class is the base class for different class of points (C3DPoint, CUVWPoint...)
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
CRGBColor handles an r, g, b, a color that can be initialized in different way.
Definition RGBColor.h:22
CVCPoint is a point that have a CRGBColor and which is used for handling object vertex colors.
Definition VCPoint.h:22
Definition XArchive.h:17