0024171: Eliminate CLang compiler warning -Wreorder
[occt.git] / src / VrmlData / VrmlData_Color.hxx
1 // Created on: 2006-05-28
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2006-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20
21
22 #ifndef VrmlData_Color_HeaderFile
23 #define VrmlData_Color_HeaderFile
24
25 #include <VrmlData_ArrayVec3d.hxx>
26 #include <Quantity_Color.hxx>
27 #include <gp_XYZ.hxx>
28
29 /**
30  *  Implementation of the node Color
31  */
32 class VrmlData_Color : public VrmlData_ArrayVec3d
33 {
34  public:
35   // ---------- PUBLIC METHODS ----------
36
37   /**
38    * Empty constructor.
39    */
40   inline VrmlData_Color () {}
41
42   /**
43    * Constructor.
44    */
45   inline VrmlData_Color                 (const VrmlData_Scene&  theScene,
46                                          const char             * theName,
47                                          const size_t           nColors    =0,
48                                          const gp_XYZ           * arrColors=0L)
49     : VrmlData_ArrayVec3d (theScene, theName, nColors, arrColors)
50   {}
51
52   /**
53    * Query one color
54    * @param i
55    *   index in the array of colors [0 .. N-1]
56    * @return
57    *   the color value for the index. If index irrelevant, returns (0., 0., 0.)
58    */
59   inline const Quantity_Color Color (const Standard_Integer i) const
60   { return Quantity_Color (Value(i).X(), Value(i).Y(), Value(i).Z(),
61                            Quantity_TOC_RGB); }
62
63   /**
64    * Set the array data
65    */
66   inline void           SetColors (const size_t nColors,
67                                    const gp_XYZ * arrColors)
68   { myLength = nColors; myArray = arrColors; }
69
70   /**
71    * Create a copy of this node.
72    * If the parameter is null, a new copied node is created. Otherwise new node
73    * is not created, but rather the given one is modified.<p>
74    */
75   Standard_EXPORT virtual Handle(VrmlData_Node)
76                         Clone     (const Handle(VrmlData_Node)& theOther)const;
77
78   /**
79    * Read the Node from input stream.
80    */
81   Standard_EXPORT virtual VrmlData_ErrorStatus
82                         Read      (VrmlData_InBuffer& theBuffer);
83
84   /**
85    * Write the Node to the Scene output.
86    */
87   Standard_EXPORT virtual VrmlData_ErrorStatus
88                         Write     (const char * thePrefix) const;
89
90  private:
91   // ---------- PRIVATE FIELDS ----------
92
93
94
95
96  public:
97 // Declaration of CASCADE RTTI
98 DEFINE_STANDARD_RTTI (VrmlData_Color)
99 };
100
101 // Definition of HANDLE object using Standard_DefineHandle.hxx
102 DEFINE_STANDARD_HANDLE (VrmlData_Color, VrmlData_ArrayVec3d)
103
104
105 #endif