1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
/*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2010 - DIGITEO - Manuel Juliachs
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
*
*/
#ifndef NGON_GENERAL_DATA_HXX
#define NGON_GENERAL_DATA_HXX
#include <string>
#include "NgonData.hxx"
extern "C" {
#include "BOOL.h"
}
/**
* General n-gon data class
*/
class NgonGeneralData : public NgonData
{
private :
/** The array of color values */
double* colorValues;
/** The size of the color values array */
int numColors;
protected :
/** The coordinates array */
double* coordinates;
public :
/**
* Constructor
*/
NgonGeneralData(void);
/**
* Destructor
*/
virtual ~NgonGeneralData(void);
/**
* Returns the identifier associated to a property name
* @param[in] propertyName the property name
* @return the property identifier
*/
int getPropertyFromName(int propertyName);
/**
* Sets a data property
* @param[in] property the property identifier
* @param[in] value a pointer to the property values
* @param[in] numElements the number of elements to set
* @return 1 if the property has been successfully set, 0 otherwise
*/
int setDataProperty(int property, void const* value, int numElements);
/**
* Returns a data property
* @param[in] property the property identifier
* @param[out] a pointer to a pointer to the returned property values
*/
void getDataProperty(int property, void **_pvData);
/**
* Returns the data coordinates array
* @return a pointer to the coordinates array
*/
double* getData();
/**
* Returns the data x coordinates array
* @return a pointer to the x coordinates
*/
double* getDataX(void);
/**
* Returns the data y coordinates array
* @return a pointer to the y coordinates
*/
double* getDataY(void);
/**
* Returns the data z coordinates array
* @return a pointer to the z coordinates
*/
double* getDataZ(void);
/**
* Sets the coordinates data
* @param[in] data a pointer to the data (3 * numElements values)
* @param[in] numElements the number of points in the data array ( #n-gons * #vertices per n-gon)
*/
void setData(double const* data, int numElements);
/**
* Sets the x coordinates data
* @param[in] data a pointer to the data (numElements values)
* @param[in] numElements the number of points in the data array ( #n-gons * #vertices per n-gon)
*/
void setDataX(double const* data, int numElements);
/**
* Sets the y coordinates data
* @param[in] data a pointer to the data (numElements values)
* @param[in] numElements the number of points in the data array ( #n-gons * #vertices per n-gon)
*/
void setDataY(double const* data, int numElements);
/**
* Sets the z coordinates data
* @param[in] data a pointer to the data (numElements values)
* @param[in] numElements the number of points in the data array ( #n-gons * #vertices per n-gon)
*/
void setDataZ(double const* data, int numElements);
/**
* Returns the number of elements (number of n-gons)
* @return the number of n-gons
*/
int getNumElements(void);
/**
* Sets the number of elements (number of n-gons,
* number of vertices per n-gon, and number of color values)
* Resizes the data coordinates array if required, must therefore
* be called before any setData call.
* @param[in] numElementsArray a pointer to a 3-element array (# n-gons, # vertices per n-gon, # color values)
* @return 1 if it succeeded, 0 if the allocation failed
*/
int setNumElementsArray(int const* numElementsArray);
/**
* Returns the color values array
* @return a pointer to the color values array
*/
double* getColors(void);
/**
* Sets the color values array
* @param[in] colors a pointer to the color values array
* @param[in] numElements the number of color values in the data array
*/
void setColors(double const* colors, int numElements);
/**
* Returns the number of colors
* @return the number of colors
*/
int getNumColors(void);
};
#endif
|