Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:32

0001 // Created on: 2006-05-25
0002 // Created by: Alexander GRIGORIEV
0003 // Copyright (c) 2006-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef VrmlData_Material_HeaderFile
0017 #define VrmlData_Material_HeaderFile
0018 
0019 #include <VrmlData_Node.hxx>
0020 #include <Quantity_Color.hxx>
0021 
0022 /**
0023  *  Implementation of the Material node
0024  */
0025 class VrmlData_Material : public VrmlData_Node
0026 {
0027  public:
0028   // ---------- PUBLIC METHODS ----------
0029 
0030   /**
0031    * Empty constructor
0032    */
0033   Standard_EXPORT VrmlData_Material ();
0034 
0035   /**
0036    * Constructor
0037    */
0038   Standard_EXPORT VrmlData_Material
0039                                 (const VrmlData_Scene&  theScene,
0040                                  const char             * theName,
0041                                  const Standard_Real theAmbientIntensity = -1.,
0042                                  const Standard_Real theShininess        = -1.,
0043                                  const Standard_Real theTransparency     = -1.);
0044 
0045   /**
0046    * Query the Ambient Intensity value
0047    */
0048   inline Standard_Real
0049                 AmbientIntensity() const        { return myAmbientIntensity; }
0050 
0051   /**
0052    * Query the Shininess value
0053    */
0054   inline Standard_Real
0055                 Shininess       () const        { return myShininess; }
0056 
0057   /**
0058    * Query the Transparency value
0059    */
0060   inline Standard_Real
0061                 Transparency    () const        { return myTransparency; }
0062 
0063   /**
0064   * Query the Ambient color
0065   */
0066   inline const Quantity_Color&
0067                 AmbientColor    () const        { return myAmbientColor; }
0068 
0069   /**
0070    * Query the Diffuse color
0071    */
0072   inline const Quantity_Color&
0073                 DiffuseColor    () const        { return myDiffuseColor; }
0074 
0075   /**
0076    * Query the Emissive color
0077    */
0078   inline const Quantity_Color&
0079                 EmissiveColor   () const        { return myEmissiveColor; }
0080 
0081   /**
0082    * Query the Specular color
0083    */
0084   inline const Quantity_Color&
0085                 SpecularColor   () const        { return mySpecularColor; }
0086 
0087   /**
0088    * Set the Ambient Intensity value
0089    */
0090   inline void   SetAmbientIntensity
0091                                 (const Standard_Real theAmbientIntensity)
0092   { myAmbientIntensity = theAmbientIntensity; }
0093 
0094   /**
0095    * Set the Shininess value
0096    */
0097   inline void   SetShininess    (const Standard_Real theShininess)
0098   { myShininess = theShininess; }
0099 
0100   /**
0101    * Set the Transparency value
0102    */
0103   inline void   SetTransparency (const Standard_Real theTransparency)
0104   { myTransparency = theTransparency; }
0105 
0106   /**
0107   * Query the Ambient color
0108   */
0109   inline void   SetAmbientColor (const Quantity_Color& theColor)
0110   {
0111     myAmbientColor = theColor;
0112   }
0113 
0114   /**
0115    * Query the Diffuse color
0116    */
0117   inline void   SetDiffuseColor (const Quantity_Color& theColor)
0118   { myDiffuseColor = theColor; }
0119 
0120   /**
0121    * Query the Emissive color
0122    */
0123   inline void   SetEmissiveColor (const Quantity_Color& theColor)
0124   { myEmissiveColor = theColor; }
0125 
0126   /**
0127    * Query the Specular color
0128    */
0129   inline void   SetSpecularColor (const Quantity_Color& theColor)
0130   { mySpecularColor = theColor; }
0131 
0132   /**
0133    * Create a copy of this node.
0134    * If the parameter is null, a new copied node is created. Otherwise new node
0135    * is not created, but rather the given one is modified.
0136    */
0137   Standard_EXPORT virtual Handle(VrmlData_Node)
0138                 Clone           (const Handle(VrmlData_Node)& theOther)const Standard_OVERRIDE;
0139 
0140   /**
0141    * Read the Node from input stream.
0142    */
0143   Standard_EXPORT virtual VrmlData_ErrorStatus
0144                 Read            (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE;
0145 
0146   /**
0147    * Write the Node to the Scene output.
0148    */
0149   Standard_EXPORT virtual VrmlData_ErrorStatus
0150                 Write           (const char * thePrefix) const Standard_OVERRIDE;
0151 
0152   /**
0153    * Returns True if the node is default, so that it should not be written.
0154    */
0155   Standard_EXPORT virtual Standard_Boolean
0156                 IsDefault       () const Standard_OVERRIDE;
0157 
0158  protected:
0159   // ---------- PROTECTED METHODS ----------
0160 
0161  private:
0162   // ---------- PRIVATE FIELDS ----------
0163 
0164   Standard_Real         myAmbientIntensity;
0165   Standard_Real         myShininess;
0166   Standard_Real         myTransparency;
0167   Quantity_Color        myAmbientColor;
0168   Quantity_Color        myDiffuseColor;
0169   Quantity_Color        myEmissiveColor;
0170   Quantity_Color        mySpecularColor;
0171 
0172  public:
0173 // Declaration of CASCADE RTTI
0174 DEFINE_STANDARD_RTTIEXT(VrmlData_Material,VrmlData_Node)
0175 };
0176 
0177 // Definition of HANDLE object using Standard_DefineHandle.hxx
0178 DEFINE_STANDARD_HANDLE (VrmlData_Material, VrmlData_Node)
0179 
0180 
0181 #endif