Integrated various changes worked on at the Glasgow Science Center. Changes

include change the CameraManipulators so they work with double for time
instead of float.  Also added support for DataType to osg::StateAttribute
and StateSet so that they can be set to either STATIC or DYNAMIC, this
allows the optimizer to know whether that an attribute can be optimized
or not.
This commit is contained in:
Robert Osfield
2002-03-14 17:34:08 +00:00
parent 9e92b9b899
commit c49c62ee15
15 changed files with 105 additions and 27 deletions

View File

@@ -149,10 +149,19 @@ class SG_EXPORT StateAttribute : public Object
COLORMATRIX
};
StateAttribute() {}
/** Range of types that the StateAttribute can be.*/
enum DataType
{
DYNAMIC,
STATIC
};
StateAttribute():_datatype(STATIC) {}
StateAttribute(const StateAttribute& sa,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Object(sa,copyop) {}
Object(sa,copyop),_datatype(sa._datatype) {}
/** Clone the type of an attribute, with Object* return type.
@@ -172,6 +181,11 @@ class SG_EXPORT StateAttribute : public Object
/** return the Type identifier of the attribute's class type.*/
virtual const Type getType() const = 0;
inline void setDataType(DataType type) { _datatype = type; }
inline const DataType getDataType() const { return _datatype; }
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const = 0;
@@ -199,6 +213,8 @@ class SG_EXPORT StateAttribute : public Object
virtual ~StateAttribute() {}
DataType _datatype;
};
}

View File

@@ -50,7 +50,10 @@ class SG_EXPORT StateSet : public Object
nodes which inherit all of their modes for the global state.*/
void setAllToInherit();
/** merge this stateset with stateset rhs, this overrides
inline void setDataType(osg::StateAttribute::DataType type) { _datatype = type; }
inline const osg::StateAttribute::DataType getDataType() const { return _datatype; }
/** merge this stateset with stateset rhs, this overrides
* the rhs if OVERRIDE is specified, otherwise rhs takes precedence.*/
void merge(const StateSet& rhs);
@@ -169,6 +172,8 @@ class SG_EXPORT StateSet : public Object
int _binNum;
std::string _binName;
osg::StateAttribute::DataType _datatype;
};
}