1 // Created on: 1993-01-11 2 // Created by: CKY / Contract Toubro-Larsen ( Niraj RANGWALA ) 3 // Copyright (c) 1993-1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 8 // This library is free software; you can redistribute it and/or modify it under 9 // the terms of the GNU Lesser General Public License version 2.1 as published 10 // by the Free Software Foundation, with special exception defined in the file 11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 12 // distribution for complete text of the license and disclaimer of any warranty. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _IGESGraph_Color_HeaderFile 18 #define _IGESGraph_Color_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_Type.hxx> 22 23 #include <Standard_Real.hxx> 24 #include <IGESData_ColorEntity.hxx> 25 #include <Standard_Boolean.hxx> 26 class TCollection_HAsciiString; 27 28 29 class IGESGraph_Color; 30 DEFINE_STANDARD_HANDLE(IGESGraph_Color, IGESData_ColorEntity) 31 32 //! defines IGESColor, Type <314> Form <0> 33 //! in package IGESGraph 34 //! 35 //! The Color Definition Entity is used to communicate the 36 //! relationship of primary colors to the intensity level of 37 //! the respective graphics devices as a percent of full 38 //! intensity range. 39 class IGESGraph_Color : public IGESData_ColorEntity 40 { 41 42 public: 43 44 45 Standard_EXPORT IGESGraph_Color(); 46 47 //! This method is used to set the fields of the class Color 48 //! - red : Red color intensity (range 0.0 to 100.0) 49 //! - green : Green color intensity (range 0.0 to 100.0) 50 //! - blue : Blue color intensity (range 0.0 to 100.0) 51 //! - aColorName : Name of the color (optional) 52 Standard_EXPORT void Init (const Standard_Real red, const Standard_Real green, const Standard_Real blue, const Handle(TCollection_HAsciiString)& aColorName); 53 54 Standard_EXPORT void RGBIntensity (Standard_Real& Red, Standard_Real& Green, Standard_Real& Blue) const; 55 56 Standard_EXPORT void CMYIntensity (Standard_Real& Cyan, Standard_Real& Magenta, Standard_Real& Yellow) const; 57 58 Standard_EXPORT void HLSPercentage (Standard_Real& Hue, Standard_Real& Lightness, Standard_Real& Saturation) const; 59 60 //! returns True if optional character string is assigned, 61 //! False otherwise. 62 Standard_EXPORT Standard_Boolean HasColorName() const; 63 64 //! if HasColorName() is True returns the Verbal description of 65 //! the Color. 66 Standard_EXPORT Handle(TCollection_HAsciiString) ColorName() const; 67 68 69 70 71 DEFINE_STANDARD_RTTIEXT(IGESGraph_Color,IGESData_ColorEntity) 72 73 protected: 74 75 76 77 78 private: 79 80 81 Standard_Real theRed; 82 Standard_Real theGreen; 83 Standard_Real theBlue; 84 Handle(TCollection_HAsciiString) theColorName; 85 86 87 }; 88 89 90 91 92 93 94 95 #endif // _IGESGraph_Color_HeaderFile 96