1 // Created on: 2006-05-28
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2006-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef VrmlData_Color_HeaderFile
17 #define VrmlData_Color_HeaderFile
19 #include <VrmlData_ArrayVec3d.hxx>
20 #include <Quantity_Color.hxx>
24 * Implementation of the node Color
26 class VrmlData_Color : public VrmlData_ArrayVec3d
29 // ---------- PUBLIC METHODS ----------
34 inline VrmlData_Color () {}
39 inline VrmlData_Color (const VrmlData_Scene& theScene,
41 const size_t nColors =0,
42 const gp_XYZ * arrColors=0L)
43 : VrmlData_ArrayVec3d (theScene, theName, nColors, arrColors)
49 * index in the array of colors [0 .. N-1]
51 * the color value for the index. If index irrelevant, returns (0., 0., 0.)
53 inline const Quantity_Color Color (const Standard_Integer i) const
54 { return Quantity_Color (Value(i).X(), Value(i).Y(), Value(i).Z(),
60 inline void SetColors (const size_t nColors,
61 const gp_XYZ * arrColors)
62 { myLength = nColors; myArray = arrColors; }
65 * Create a copy of this node.
66 * If the parameter is null, a new copied node is created. Otherwise new node
67 * is not created, but rather the given one is modified.<p>
69 Standard_EXPORT virtual Handle(VrmlData_Node)
70 Clone (const Handle(VrmlData_Node)& theOther)const Standard_OVERRIDE;
73 * Read the Node from input stream.
75 Standard_EXPORT virtual VrmlData_ErrorStatus
76 Read (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE;
79 * Write the Node to the Scene output.
81 Standard_EXPORT virtual VrmlData_ErrorStatus
82 Write (const char * thePrefix) const Standard_OVERRIDE;
85 // ---------- PRIVATE FIELDS ----------
91 // Declaration of CASCADE RTTI
92 DEFINE_STANDARD_RTTI_INLINE(VrmlData_Color,VrmlData_ArrayVec3d)
95 // Definition of HANDLE object using Standard_DefineHandle.hxx
96 DEFINE_STANDARD_HANDLE (VrmlData_Color, VrmlData_ArrayVec3d)