CFx SDK Documentation  2023 SP0
AveMaterial.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 #ifndef OD_AVEMATERIAL_H
27 #define OD_AVEMATERIAL_H
28 
29 #include "TD_PackPush.h"
30 
31 #include "Ve/AveDefs.h"
32 #include "RxObject.h"
33 #include "DbEntity.h"
34 #include "IdArrays.h"
35 
36 class OdDbObjectId;
37 class OdDbDatabase;
38 class OdAveMaterialImpl;
39 class OdAveMaterial;
44 
56 {
57 public:
59 
70  static OdAveMaterialPtr getMaterial(const OdDbObjectId& blockRefId);
71 
77  static OdString getMaterialName(const OdDbObjectId& blockRefId);
78 
87  OdResult writeMaterial(OdDbDatabase* pDb = NULL, const OdDbHandle& holderHandle = 0);
88 
95  bool attachToObject(OdDbObjectId entityId);
96 
104 
118  bool attachToACI(OdUInt16 colorIndex);
119 
124  static void detachFromObject(OdDbObjectId entityId);
125 
130  static void detachFromLayer(OdDbObjectId layerId);
131 
142  static void detachFromACI(OdDbDatabase* pDb, OdUInt16 colorIndex);
143 
154  static bool getAttachedMaterial(const OdDbObjectId& sourceId, OdDbObjectId& blockRefId);
155 
166  static bool getAttachedMaterial(OdDbDatabase* pDb, OdUInt16 colorIndex, OdDbObjectId& blockRefId);
167 
182  static void getAciMaterialMap(OdDbDatabase* pDb, OdDbObjectIdArray& blockRefIds);
183 
199 
221 
226  OdString name() const;
231 
239  void setName(const OdString& name);
240 
245  void setDescription(const OdString& description);
246 
254  double ambientFactor() const;
255 
268  bool ambientColorCurrent() const;
269 
273  bool ambientLock() const;
274 
280  void setAmbientFactor(double ambientFactor);
281 
287  void setAmbientColor(OdUInt32 ambientColor);
293  void setAmbientColorCurrent(bool currentColor);
298  void setAmbientLock(bool ambientLock);
299 
300 
308  double diffuseFactor() const;
309 
317 
323  bool diffuseColorCurrent() const;
324 
325 
331 
339  void setDiffuseFactor(double diffuseFactor);
345  void setDiffuseColor(OdUInt32 diffuseColor);
346 
353  void setDiffuseColorCurrent(bool currentColor);
354 
362  double specularFactor() const;
363 
377  bool specularColorCurrent() const;
382  bool specularMirror() const;
383 
388  bool specularLock() const;
389 
394  const OdAveBitmap& specularBitmap() const;
395 
396 
403  void setSpecularFactor(double specularFactor);
410  void setSpecularColor(OdUInt32 specularColor);
411 
418  void setSpecularColorCurrent(bool colorCurrrent);
424  void setSpecularMirror(bool mirror);
425 
433  void setSpecularLock(bool specularLock);
434 
444  double roughness() const;
454  void setRoughness(double);
455 
467  double transparency() const;
485  void setTransparency(double transparency);
486 
491  double refraction() const;
492 
499  void setRefraction(double refraction) const;
500 
508  const OdAveBitmap& bumpMap() const;
509 
514 
519 
523  void setHandleDbMaterial(const OdString& sDesc);
524 
526 protected:
528  OdAveMaterial(OdAveMaterialImpl* pImpl);
529 
530  OdAveMaterialImpl* m_pImpl;
531  friend class OdAveMaterialImpl;
532 };
533 
544 {
545 public:
547 
553  {
554  kFirst = 0,
555  kSecond = 1,
556  kThird = 2,
557  kFourth = 3
558  };
559 
561 
584  double colorFactor(GraniteColor graniteColor);
585 
604  OdUInt32 color(GraniteColor graniteColor);
605 
630  void setColorFactor(GraniteColor graniteColor, double colorFactor);
631 
653  void setColor(GraniteColor graniteColor, OdUInt32 color);
654 
667  double sharpness();
680  void setSharpness(double sharpness);
681 
689  double scale();
699  void setScale(double scale);
700 
701 protected:
703  OdAveGraniteMaterial(OdAveMaterialImpl* pImpl);
704 };
709 
720 {
721 public:
723 
725 
740 
746  void stoneColor(OdUInt32 color);
747 
753  void veinColor(OdUInt32 color);
754 
770  void setTurbulence(OdUInt32 turbulence);
771 
784  double sharpness();
796  void setSharpness(double sharpness);
797 
798 
806  double scale();
807 
817  void setScale(double scale);
818 
819 protected:
821  OdAveMarbleMaterial(OdAveMaterialImpl* pImpl);
822 };
823 
828 
837 {
838 public:
840 
842 
859  void setLightColor(OdUInt32 lightColor);
864  void setDarkColor(OdUInt32 darkColor);
865 
878  double lightDark();
889  void setLightDark(double lightDark);
890 
898  double ringDensity();
906  void setRingDensity(double ringDensity);
907 
921  double ringWidth();
934  void setRingWidth(double ringWidth);
935 
948  double ringShape();
961  void setRingShape(double ringShape) ;
962 
970  double scale();
971 
981  void setScale(double scale);
982 
983 protected:
985  OdAveWoodMaterial(OdAveMaterialImpl* pImpl);
986 };
987 
992 
1001 
1003 
1005 
1006 #include "TD_PackPop.h"
1007 
1008 #endif // OD_AVEMATERIAL_H
1009 
#define AVE_EXPORT
Definition: AveExport.h:37
AVE_EXPORT void oddbGetMaterialIds(OdDbDatabase *pDb, OdDbObjectIdArray &ids)
OdSmartPtr< OdAveMaterial > OdAveMaterialPtr
Definition: AveMaterial.h:39
AVE_EXPORT OdRxIteratorPtr oddbGetMaterials(OdDbDatabase *pDb)
OdSmartPtr< OdAveWoodMaterial > OdAveWoodMaterialPtr
Definition: AveMaterial.h:991
OdSmartPtr< OdAveMarbleMaterial > OdAveMarbleMaterialPtr
Definition: AveMaterial.h:827
OdSmartPtr< OdAveGraniteMaterial > OdAveGraniteMaterialPtr
Definition: AveMaterial.h:708
scale
Definition: DimVarDefs.h:1684
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
unsigned short OdUInt16
OdResult
Definition: OdResult.h:29
double colorFactor(GraniteColor graniteColor)
void setScale(double scale)
OdUInt32 color(GraniteColor graniteColor)
OdAveGraniteMaterial(OdAveMaterialImpl *pImpl)
void setColorFactor(GraniteColor graniteColor, double colorFactor)
void setColor(GraniteColor graniteColor, OdUInt32 color)
virtual OdAve::MaterialType type()
ODRX_DECLARE_MEMBERS(OdAveGraniteMaterial)
void setSharpness(double sharpness)
virtual OdAve::MaterialType type()
void veinColor(OdUInt32 color)
OdUInt32 veinColor()
OdAveMarbleMaterial(OdAveMaterialImpl *pImpl)
OdUInt32 turbulence()
ODRX_DECLARE_MEMBERS(OdAveMarbleMaterial)
void setScale(double scale)
void setSharpness(double sharpness)
OdUInt32 stoneColor()
void stoneColor(OdUInt32 color)
void setTurbulence(OdUInt32 turbulence)
static void getAciMaterialMap(OdDbDatabase *pDb, OdDbObjectIdArray &blockRefIds)
bool attachToACI(OdUInt16 colorIndex)
void setDiffuseFactor(double diffuseFactor)
OdAveBitmap & specularBitmap()
static void detachFromLayer(OdDbObjectId layerId)
OdUInt32 ambientColor() const
void setSpecularColor(OdUInt32 specularColor)
double ambientFactor() const
void setSpecularMirror(bool mirror)
bool isAttribUsed(OdAve::MaterialAttrib attributes)
void setRefraction(double refraction) const
double refraction() const
void setAmbientLock(bool ambientLock)
static void detachFromACI(OdDbDatabase *pDb, OdUInt16 colorIndex)
OdString description() const
static bool getAttachedMaterial(OdDbDatabase *pDb, OdUInt16 colorIndex, OdDbObjectId &blockRefId)
void setHandleDbMaterial(const OdString &sDesc)
static OdAveMaterialPtr getMaterial(const OdDbObjectId &blockRefId)
void setAmbientFactor(double ambientFactor)
void setSpecularColorCurrent(bool colorCurrrent)
double roughness() const
bool diffuseColorCurrent() const
void setRoughness(double)
void setDiffuseColor(OdUInt32 diffuseColor)
static void detachFromObject(OdDbObjectId entityId)
bool specularMirror() const
void setTransparency(double transparency)
bool specularColorCurrent() const
void setDescription(const OdString &description)
OdAveBitmap & transparencyBitmap() const
const OdAveBitmap & bumpMap() const
void setAmbientColor(OdUInt32 ambientColor)
OdDbObjectId holderId() const
bool ambientColorCurrent() const
void setAmbientColorCurrent(bool currentColor)
bool ambientLock() const
OdAveBitmap & diffuseBitmap() const
void setSpecularFactor(double specularFactor)
bool attachToObject(OdDbObjectId entityId)
ODRX_DECLARE_MEMBERS(OdAveMaterial)
OdResult writeMaterial(OdDbDatabase *pDb=NULL, const OdDbHandle &holderHandle=0)
void setDiffuseColorCurrent(bool currentColor)
OdAveMaterial(OdAveMaterialImpl *pImpl)
const OdAveBitmap & specularBitmap() const
OdString name() const
double diffuseFactor() const
OdAveMaterialImpl * m_pImpl
Definition: AveMaterial.h:530
double specularFactor() const
bool specularLock() const
virtual OdAve::MaterialType type()
void setSpecularLock(bool specularLock)
static OdString getMaterialName(const OdDbObjectId &blockRefId)
OdUInt32 diffuseColor() const
bool attachToLayer(OdDbObjectId layerId)
OdUInt32 specularColor() const
double transparency() const
static bool getAttachedMaterial(const OdDbObjectId &sourceId, OdDbObjectId &blockRefId)
OdAveBitmap & bumpMap()
OdString handleDbMaterial() const
void setName(const OdString &name)
OdUInt32 darkColor()
virtual OdAve::MaterialType type()
void setRingShape(double ringShape)
void setScale(double scale)
OdAveWoodMaterial(OdAveMaterialImpl *pImpl)
void setDarkColor(OdUInt32 darkColor)
void setRingDensity(double ringDensity)
double ringDensity()
void setLightColor(OdUInt32 lightColor)
ODRX_DECLARE_MEMBERS(OdAveWoodMaterial)
void setLightDark(double lightDark)
OdUInt32 lightColor()
void setRingWidth(double ringWidth)
GLuint const GLchar * name
Definition: gles2_ext.h:265
MaterialType
Definition: AveDefs.h:40
MaterialAttrib
Definition: AveDefs.h:48