OpendTect  7.0
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
visBase::Material Class Reference
Inheritance diagram for visBase::Material:
[legend]

Public Types

enum  ColorMode {
  Ambient , Diffuse , Specular , Emission ,
  AmbientAndDiffuse , Off
}
 
- Public Types inherited from ObjectWithName
typedef OD::String name_type
 

Public Member Functions

 Material ()
 
void attachGeometry (osg::Geometry *)
 
void clear ()
 
void detachGeometry (osg::Geometry *)
 
void fillPar (IOPar &) const
 
float getAmbience () const
 
OD::Color getColor (int matnr=0) const
 
ColorMode getColorMode () const
 
const TypeSet< OD::ColorgetColors ()
 
float getDiffIntensity () const
 
float getEmmIntensity () const
 
float getShininess () const
 
float getSpecIntensity () const
 
float getTransparency (int idx=0) const
 
int nrOfMaterial () const
 
void removeColor (int idx)
 
void rescaleTransparency (float bendpower)
 
void setAllTransparencies (float n)
 
void setAmbience (float)
 
void setColor (const OD::Color &, int=-1, bool trigger=true)
 
void setColorBindType (unsigned int)
 
void setColorMode (ColorMode)
 
void setColors (const TypeSet< OD::Color > &, bool trigger=true)
 
void setDiffIntensity (float)
 
void setEmmIntensity (float)
 
void setFrom (const Material &, bool trigger=false)
 
void setPropertiesFrom (const Material &, bool trigger=false)
 
void setShininess (float)
 
void setSpecIntensity (float)
 
void setTransparencies (float, const Interval< int > &range)
 
void setTransparency (float, int idx=0, bool updt=false)
 
int usePar (const IOPar &)
 
- Public Member Functions inherited from visBase::NodeState
void attachStateSet (osg::StateSet *)
 
void detachStateSet (osg::StateSet *)
 
virtual void setPixelDensity (float)
 
- Public Member Functions inherited from SharedObject
 SharedObject (const char *nm=nullptr)
 
 SharedObject (const SharedObject &)
 
- Public Member Functions inherited from NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
const name_typename () const override
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual void setName (const char *nm)
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 
- Public Member Functions inherited from RefCount::Referenced
void addObserver (WeakPtrBase *obs)
 Not for normal use. May become private. More...
 
int nrRefs () const
 Only for expert use. More...
 
void ref () const
 
bool refIfReffed () const
 Don't use in production, for debugging. More...
 
void removeObserver (WeakPtrBase *obs)
 Not for normal use. May become private. More...
 
bool tryRef () const
 Not for normal use. May become private. More...
 
void unRef () const
 
void unRefNoDelete () const
 

Public Attributes

Notifier< Materialchange
 

Private Member Functions

 ~Material ()
 
void createOsgColorArray (int)
 
float getRescaledTransparency () const
 Assumes object is write-locked. More...
 
void removeOsgColor (int)
 
void setColorArray (osg::Array *)
 
void updateOsgMaterial ()
 Used when no array is present. More...
 

Static Private Member Functions

static const char * sKeyAmbience ()
 
static const char * sKeyColor ()
 
static const char * sKeyDiffIntensity ()
 
static const char * sKeyEmmissiveIntensity ()
 
static const char * sKeyShininess ()
 
static const char * sKeySpectralIntensity ()
 
static const char * sKeyTransparency ()
 

Private Attributes

float ambience_
 
ObjectSet< osg::Geometry > attachedgeoms_
 
OD::Color color_
 
unsigned int colorbindtype_
 
float diffuseintensity_
 
float emmissiveintensity_
 
Threads::Lock lock_
 
osg::Material * material_
 
osg::Array * osgcolorarray_
 
float shininess_
 
float specularintensity_
 
float transparencybendpower_
 

Friends

class OsgColorArrayUpdator
 

Additional Inherited Members

- Static Public Member Functions inherited from SharedObject
static Notifier< SharedObject > & instanceCreated ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Static Public Member Functions inherited from RefCount::Referenced
static bool isSane (const Referenced *)
 
- Protected Member Functions inherited from visBase::NodeState
 NodeState ()
 
virtual ~NodeState ()
 
template<class T >
T * addAttribute (T *a)
 
template<class T >
void removeAttribute (T *a)
 
- Protected Member Functions inherited from SharedObject
virtual ~SharedObject ()
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 
- Protected Member Functions inherited from RefCount::Referenced
 Referenced ()
 
 Referenced (const Referenced &)
 
virtual ~Referenced ()
 
Referencedoperator= (const Referenced &)
 
- Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > delalreadytriggered_
 
Notifier< NamedCallBackerdelnotif_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Detailed Description

<>

Member Enumeration Documentation

◆ ColorMode

Enumerator
Ambient 
Diffuse 
Specular 
Emission 
AmbientAndDiffuse 
Off 

Constructor & Destructor Documentation

◆ Material()

visBase::Material::Material ( )

◆ ~Material()

visBase::Material::~Material ( )
private

Member Function Documentation

◆ attachGeometry()

void visBase::Material::attachGeometry ( osg::Geometry *  )

◆ clear()

void visBase::Material::clear ( )

◆ createOsgColorArray()

void visBase::Material::createOsgColorArray ( int  )
private

◆ detachGeometry()

void visBase::Material::detachGeometry ( osg::Geometry *  )

◆ fillPar()

void visBase::Material::fillPar ( IOPar ) const

◆ getAmbience()

float visBase::Material::getAmbience ( ) const

◆ getColor()

OD::Color visBase::Material::getColor ( int  matnr = 0) const

◆ getColorMode()

ColorMode visBase::Material::getColorMode ( ) const

◆ getColors()

const TypeSet<OD::Color> visBase::Material::getColors ( )

◆ getDiffIntensity()

float visBase::Material::getDiffIntensity ( ) const

◆ getEmmIntensity()

float visBase::Material::getEmmIntensity ( ) const

◆ getRescaledTransparency()

float visBase::Material::getRescaledTransparency ( ) const
private

Assumes object is write-locked.

◆ getShininess()

float visBase::Material::getShininess ( ) const

◆ getSpecIntensity()

float visBase::Material::getSpecIntensity ( ) const

◆ getTransparency()

float visBase::Material::getTransparency ( int  idx = 0) const

◆ nrOfMaterial()

int visBase::Material::nrOfMaterial ( ) const

◆ removeColor()

void visBase::Material::removeColor ( int  idx)

◆ removeOsgColor()

void visBase::Material::removeOsgColor ( int  )
private

◆ rescaleTransparency()

void visBase::Material::rescaleTransparency ( float  bendpower)

◆ setAllTransparencies()

void visBase::Material::setAllTransparencies ( float  n)

Should be between 0 and 1

◆ setAmbience()

void visBase::Material::setAmbience ( float  )

Should be between 0 and 1

◆ setColor()

void visBase::Material::setColor ( const OD::Color ,
int  = -1,
bool  trigger = true 
)

set material's od colors by input colors. using setColors() to instead of this calling if having to setColor many times.

◆ setColorArray()

void visBase::Material::setColorArray ( osg::Array *  )
private

◆ setColorBindType()

void visBase::Material::setColorBindType ( unsigned int  )

◆ setColorMode()

void visBase::Material::setColorMode ( ColorMode  )

◆ setColors()

void visBase::Material::setColors ( const TypeSet< OD::Color > &  ,
bool  trigger = true 
)

set material's od colors by input colors.

◆ setDiffIntensity()

void visBase::Material::setDiffIntensity ( float  )

Should be between 0 and 1

◆ setEmmIntensity()

void visBase::Material::setEmmIntensity ( float  )

Should be between 0 and 1

◆ setFrom()

void visBase::Material::setFrom ( const Material ,
bool  trigger = false 
)

◆ setPropertiesFrom()

void visBase::Material::setPropertiesFrom ( const Material ,
bool  trigger = false 
)

set materials by input material's properties

◆ setShininess()

void visBase::Material::setShininess ( float  )

Should be between 0 and 1

◆ setSpecIntensity()

void visBase::Material::setSpecIntensity ( float  )

Should be between 0 and 1

◆ setTransparencies()

void visBase::Material::setTransparencies ( float  ,
const Interval< int > &  range 
)

◆ setTransparency()

void visBase::Material::setTransparency ( float  ,
int  idx = 0,
bool  updt = false 
)

Should be between 0 and 1

◆ sKeyAmbience()

static const char* visBase::Material::sKeyAmbience ( )
staticprivate

◆ sKeyColor()

static const char* visBase::Material::sKeyColor ( )
staticprivate

◆ sKeyDiffIntensity()

static const char* visBase::Material::sKeyDiffIntensity ( )
staticprivate

◆ sKeyEmmissiveIntensity()

static const char* visBase::Material::sKeyEmmissiveIntensity ( )
staticprivate

◆ sKeyShininess()

static const char* visBase::Material::sKeyShininess ( )
staticprivate

◆ sKeySpectralIntensity()

static const char* visBase::Material::sKeySpectralIntensity ( )
staticprivate

◆ sKeyTransparency()

static const char* visBase::Material::sKeyTransparency ( )
staticprivate

◆ updateOsgMaterial()

void visBase::Material::updateOsgMaterial ( )
private

Used when no array is present.

◆ usePar()

int visBase::Material::usePar ( const IOPar )

Friends And Related Function Documentation

◆ OsgColorArrayUpdator

friend class OsgColorArrayUpdator
friend

Member Data Documentation

◆ ambience_

float visBase::Material::ambience_
private

◆ attachedgeoms_

ObjectSet<osg::Geometry> visBase::Material::attachedgeoms_
private

◆ change

Notifier<Material> visBase::Material::change

◆ color_

OD::Color visBase::Material::color_
private

◆ colorbindtype_

unsigned int visBase::Material::colorbindtype_
private

◆ diffuseintensity_

float visBase::Material::diffuseintensity_
private

◆ emmissiveintensity_

float visBase::Material::emmissiveintensity_
private

◆ lock_

Threads::Lock visBase::Material::lock_
mutableprivate

the lock will protect below variables

◆ material_

osg::Material* visBase::Material::material_
private

◆ osgcolorarray_

osg::Array* visBase::Material::osgcolorarray_
private

◆ shininess_

float visBase::Material::shininess_
private

◆ specularintensity_

float visBase::Material::specularintensity_
private

◆ transparencybendpower_

float visBase::Material::transparencybendpower_
private

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024