Changed ABSOLUTE and RELATIVE to ABSOLUTE_RF and RELATIVE_RF to avoid stooppid Win32 #define

This commit is contained in:
Robert Osfield 2004-10-24 20:04:00 +00:00
parent 1dd682f6b4
commit b70ff91eaf
35 changed files with 72 additions and 72 deletions

View File

@ -144,7 +144,7 @@ void DistortionNode::createHUDSubgraph()
// create the hud.
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
modelview_abs->addChild(geode);

View File

@ -744,7 +744,7 @@ osg::Node* ForestTechniqueManager::createHUDWithText(const std::string& str)
// create the hud.
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
modelview_abs->addChild(geode);

View File

@ -232,7 +232,7 @@ osg::Group *build_hud_base(osg::Group *root)
root->addChild(proj.get());
osg::ref_ptr<osg::MatrixTransform> xform = new osg::MatrixTransform(osg::Matrix::identity());
xform->setReferenceFrame(osg::Transform::ABSOLUTE);
xform->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
proj->addChild(xform.get());
osg::StateSet *ss = xform->getOrCreateStateSet();

View File

@ -102,7 +102,7 @@ osg::Node* createHUD()
text->setFont(timesFont);
text->setPosition(position);
text->setText("And add an osg::ModelViewMatrix set to ABSOLUTE to ensure\nit remains independent from any external model view matrices.");
text->setText("And add an osg::ModelViewMatrix set to ABSOLUTE_RF to ensure\nit remains independent from any external model view matrices.");
position += delta;
}
@ -148,7 +148,7 @@ osg::Node* createHUD()
// create the hud.
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
modelview_abs->addChild(geode);

View File

@ -111,7 +111,7 @@ osg::Node* createHUD(osgText::Text* updateText)
// eg to be used as a menuing/help system!
// Can pick texts too!
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
osg::Projection* projection = new osg::Projection;

View File

@ -47,10 +47,10 @@ public:
// operators on the particle set via the operate() method.
void beginOperate(osgParticle::Program *prg)
{
// we have to check whether the reference frame is relative to parents
// we have to check whether the reference frame is RELATIVE_RF to parents
// or it's absolute; in the first case, we must transform the vectors
// from local to world space.
if (prg->getReferenceFrame() == osgParticle::Program::RELATIVE) {
if (prg->getReferenceFrame() == osgParticle::Program::RELATIVE_RF) {
// transform the center point (full transformation)
xf_center_ = prg->transformLocalToWorld(center_);
// transform the axis vector (only rotation and scale)

View File

@ -80,7 +80,7 @@ public:
virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor*) const
{
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.preMult(getMatrix());
}
@ -96,7 +96,7 @@ public:
{
const osg::Matrix& inverse = getInverseMatrix();
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.postMult(inverse);
}

View File

@ -112,7 +112,7 @@ osg::Node* createHUD(osgText::Text* updateText)
// eg to be used as a menuing/help system!
// Can pick texts too!
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
osg::Projection* projection = new osg::Projection;

View File

@ -84,7 +84,7 @@ osg::Node * createScalarBar_HUD()
stateset->setRenderBinDetails(11, "RenderBin");
osg::MatrixTransform * modelview = new osg::MatrixTransform;
modelview->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
osg::Matrixd matrix(osg::Matrixd::scale(1000,1000,1000) * osg::Matrixd::translate(120,10,0)); // I've played with these values a lot and it seems to work, but I have no idea why
modelview->setMatrix(matrix);
modelview->addChild(geode);

View File

@ -525,7 +525,7 @@ osg::Node* createHUD()
// create the hud.
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
modelview_abs->addChild(geode);

View File

@ -501,7 +501,7 @@ int main( int argc, char **argv )
projection->setMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
modelview_abs->addChild(createHUDText());

View File

@ -209,7 +209,7 @@ osg::Node* createHUD()
// create HUD
osg::MatrixTransform* modelview_abs = new osg::MatrixTransform;
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE);
modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
modelview_abs->setMatrix(osg::Matrix::identity());
modelview_abs->addChild(group);

View File

@ -38,19 +38,19 @@ class SG_EXPORT LightSource : public Group
enum ReferenceFrame
{
RELATIVE,
ABSOLUTE
RELATIVE_RF,
ABSOLUTE_RF
#ifdef USE_DEPRECATED_API
,
RELATIVE_TO_PARENTS=RELATIVE,
RELATIVE_TO_ABSOLUTE=ABSOLUTE,
RELATIVE_TO_PARENTS=RELATIVE_RF,
RELATIVE_TO_ABSOLUTE=ABSOLUTE_RF,
#endif
};
/** Set the light sources's ReferenceFrame, either to be relative to its
* parent reference frame, or relative to an absolute coordinate
* frame. RELATIVE is the default.
* Note: setting the ReferenceFrame to be RELATIVE_TO_ABSOLUTE will
* frame. RELATIVE_RF is the default.
* Note: setting the ReferenceFrame to be ABSOLUTE_RF will
* also set the CullingActive flag on the light source, and hence all
* of its parents, to false, thereby disabling culling of it and
* all its parents. This is necessary to prevent inappropriate

View File

@ -89,19 +89,19 @@ class SG_EXPORT Transform : public Group
enum ReferenceFrame
{
RELATIVE,
ABSOLUTE
RELATIVE_RF,
ABSOLUTE_RF
#ifdef USE_DEPRECATED_API
,
RELATIVE_TO_PARENTS=RELATIVE,
RELATIVE_TO_ABSOLUTE=ABSOLUTE,
RELATIVE_TO_PARENTS=RELATIVE_RF,
RELATIVE_TO_ABSOLUTE=ABSOLUTE_RF,
#endif
};
/** Set the transform's ReferenceFrame, either to be relative to its
* parent reference frame, or relative to an absolute coordinate
* frame. RELATIVE is the default.
* Note: Setting the ReferenceFrame to be RELATIVE_TO_ABSOLUTE will
* frame. RELATIVE_RF is the default.
* Note: Setting the ReferenceFrame to be ABSOLUTE_RF will
* also set the CullingActive flag on the transform, and hence all
* of its parents, to false, thereby disabling culling of it and
* all its parents. This is neccessary to prevent inappropriate
@ -116,7 +116,7 @@ class SG_EXPORT Transform : public Group
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
return false;
}
@ -129,7 +129,7 @@ class SG_EXPORT Transform : public Group
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
return false;
}

View File

@ -95,7 +95,7 @@ namespace osgParticle
inline void AccelOperator::beginOperate(Program *prg)
{
if (prg->getReferenceFrame() == ModularProgram::RELATIVE) {
if (prg->getReferenceFrame() == ModularProgram::RELATIVE_RF) {
xf_accel_ = prg->rotateLocalToWorld(accel_);
} else {
xf_accel_ = accel_;

View File

@ -86,7 +86,7 @@ namespace osgParticle
inline void AngularAccelOperator::beginOperate(Program *prg)
{
if (prg->getReferenceFrame() == ModularProgram::RELATIVE) {
if (prg->getReferenceFrame() == ModularProgram::RELATIVE_RF) {
xf_angular_accel_ = prg->rotateLocalToWorld(angular_accel_);
} else {
xf_angular_accel_ = angular_accel_;

View File

@ -87,7 +87,7 @@ namespace osgParticle
inline void ForceOperator::beginOperate(Program *prg)
{
if (prg->getReferenceFrame() == ModularProgram::RELATIVE) {
if (prg->getReferenceFrame() == ModularProgram::RELATIVE_RF) {
xf_force_ = prg->rotateLocalToWorld(force_);
} else {
xf_force_ = force_;

View File

@ -57,7 +57,7 @@ namespace osgParticle
/** Do something before processing particles via the <CODE>operate()</CODE> method.
Overriding this method could be necessary to query the calling <CODE>Program</CODE> object
for the current reference frame. If the reference frame is RELATIVE, then your
for the current reference frame. If the reference frame is RELATIVE_RF, then your
class should prepare itself to do all operations in local coordinates.
*/
virtual void beginOperate(Program *) {}

View File

@ -39,12 +39,12 @@ namespace osgParticle
public:
enum ReferenceFrame {
RELATIVE,
ABSOLUTE
RELATIVE_RF,
ABSOLUTE_RF
#ifdef USE_DEPRECATED_API
,
RELATIVE_TO_PARENTS=RELATIVE,
RELATIVE_TO_ABSOLUTE=ABSOLUTE,
RELATIVE_RF_TO_PARENTS=RELATIVE_RF,
RELATIVE_RF_TO_ABSOLUTE=ABSOLUTE_RF,
#endif
};

View File

@ -45,7 +45,7 @@ bool AutoTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_matrixDirty) computeMatrix();
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.preMult(_cachedMatrix);
}
@ -59,7 +59,7 @@ bool AutoTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
bool AutoTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.postMult(osg::Matrix::translate(-_position)*
osg::Matrix::rotate(_rotation.inverse())*

View File

@ -360,7 +360,7 @@ bool Group::computeBound() const
++itr)
{
const osg::Transform* transform = (*itr)->asTransform();
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE)
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE_RF)
{
bb.expandBy((*itr)->getBound());
}
@ -379,7 +379,7 @@ bool Group::computeBound() const
++itr)
{
const osg::Transform* transform = (*itr)->asTransform();
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE)
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE_RF)
{
_bsphere.expandRadiusBy((*itr)->getBound());
}

View File

@ -16,7 +16,7 @@ using namespace osg;
LightSource::LightSource():
_value(StateAttribute::ON),
_referenceFrame(RELATIVE)
_referenceFrame(RELATIVE_RF)
{
// switch off culling of light source nodes by default.
setCullingActive(false);
@ -33,7 +33,7 @@ LightSource::~LightSource()
void LightSource::setReferenceFrame(ReferenceFrame rf)
{
_referenceFrame = rf;
setCullingActive(_referenceFrame==RELATIVE);
setCullingActive(_referenceFrame==RELATIVE_RF);
}
void LightSource::setLight(Light* light)
@ -62,7 +62,7 @@ bool LightSource::computeBound() const
{
Group::computeBound();
if (_light.valid() && _referenceFrame==RELATIVE)
if (_light.valid() && _referenceFrame==RELATIVE_RF)
{
const Vec4& pos = _light->getPosition();
if (pos[3]!=0.0f)

View File

@ -29,7 +29,7 @@ MatrixTransform::MatrixTransform(const MatrixTransform& transform,const CopyOp&
MatrixTransform::MatrixTransform(const Matrix& mat )
{
_referenceFrame = RELATIVE;
_referenceFrame = RELATIVE_RF;
_matrix = mat;
_inverseDirty = false;
@ -42,7 +42,7 @@ MatrixTransform::~MatrixTransform()
bool MatrixTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.preMult(_matrix);
}
@ -57,7 +57,7 @@ bool MatrixTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) con
{
const Matrix& inverse = getInverseMatrix();
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.postMult(inverse);
}

View File

@ -21,7 +21,7 @@ PositionAttitudeTransform::PositionAttitudeTransform():
bool PositionAttitudeTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.preMult(osg::Matrix::translate(-_pivotPoint)*
osg::Matrix::scale(_scale)*
@ -41,7 +41,7 @@ bool PositionAttitudeTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVis
bool PositionAttitudeTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.postMult(osg::Matrix::translate(-_position)*
osg::Matrix::rotate(_attitude.inverse())*

View File

@ -98,7 +98,7 @@ Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath)
Transform::Transform()
{
_referenceFrame = RELATIVE;
_referenceFrame = RELATIVE_RF;
}
Transform::Transform(const Transform& transform,const CopyOp& copyop):
@ -118,7 +118,7 @@ void Transform::setReferenceFrame(ReferenceFrame rf)
_referenceFrame = rf;
// switch off culling if transform is absolute.
if (_referenceFrame==RELATIVE) setCullingActive(false);
if (_referenceFrame==RELATIVE_RF) setCullingActive(false);
else setCullingActive(true);
}

View File

@ -37,7 +37,7 @@ void osgParticle::FluidFrictionOperator::operate(Particle *P, double dt)
osg::Vec3 Fr(-R * v.x(), -R * v.y(), -R * v.z());
if (current_program_->getReferenceFrame() == ModularProgram::RELATIVE) {
if (current_program_->getReferenceFrame() == ModularProgram::RELATIVE_RF) {
Fr = current_program_->rotateLocalToWorld(Fr);
}

View File

@ -25,7 +25,7 @@ void osgParticle::ModularEmitter::emit(double dt)
if (P) {
placer_->place(P);
shooter_->shoot(P);
if (getReferenceFrame() == RELATIVE) {
if (getReferenceFrame() == RELATIVE_RF) {
P->transformPositionVelocity(getLocalToWorldMatrix());
}
}

View File

@ -13,7 +13,7 @@ using namespace osg;
osgParticle::ParticleProcessor::ParticleProcessor()
: osg::Node(),
rf_(RELATIVE),
rf_(RELATIVE_RF),
enabled_(true),
t0_(-1),
ps_(0),

View File

@ -29,12 +29,12 @@ bool LightSource_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("referenceFrame")) {
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE")) {
lightsource.setReferenceFrame(LightSource::ABSOLUTE);
lightsource.setReferenceFrame(LightSource::ABSOLUTE_RF);
fr += 2;
iteratorAdvanced = true;
}
if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) {
lightsource.setReferenceFrame(LightSource::RELATIVE);
lightsource.setReferenceFrame(LightSource::RELATIVE_RF);
fr += 2;
iteratorAdvanced = true;
}
@ -58,10 +58,10 @@ bool LightSource_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "referenceFrame ";
switch (lightsource.getReferenceFrame()) {
case LightSource::ABSOLUTE:
case LightSource::ABSOLUTE_RF:
fw << "RELATIVE_TO_ABSOLUTE\n";
break;
case LightSource::RELATIVE:
case LightSource::RELATIVE_RF:
default:
fw << "RELATIVE\n";
};

View File

@ -51,12 +51,12 @@ bool Transform_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("referenceFrame")) {
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE") ) {
transform.setReferenceFrame(Transform::ABSOLUTE);
transform.setReferenceFrame(Transform::ABSOLUTE_RF);
fr += 2;
iteratorAdvanced = true;
}
if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) {
transform.setReferenceFrame(Transform::RELATIVE);
transform.setReferenceFrame(Transform::RELATIVE_RF);
fr += 2;
iteratorAdvanced = true;
}
@ -72,10 +72,10 @@ bool Transform_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "referenceFrame ";
switch (transform.getReferenceFrame()) {
case Transform::ABSOLUTE:
case Transform::ABSOLUTE_RF:
fw << "ABSOLUTE\n";
break;
case Transform::RELATIVE:
case Transform::RELATIVE_RF:
default:
fw << "RELATIVE\n";
};

View File

@ -52,12 +52,12 @@ bool ParticleProcessor_readLocalData(osg::Object &obj, osgDB::Input &fr)
if (fr[0].matchWord("referenceFrame")) {
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE")) {
myobj.setReferenceFrame(osgParticle::ParticleProcessor::ABSOLUTE);
myobj.setReferenceFrame(osgParticle::ParticleProcessor::ABSOLUTE_RF);
fr += 2;
itAdvanced = true;
}
if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) {
myobj.setReferenceFrame(osgParticle::ParticleProcessor::RELATIVE);
myobj.setReferenceFrame(osgParticle::ParticleProcessor::RELATIVE_RF);
fr += 2;
itAdvanced = true;
}
@ -129,10 +129,10 @@ bool ParticleProcessor_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
fw.indent() << "referenceFrame ";
switch (myobj.getReferenceFrame())
{
case osgParticle::ParticleProcessor::ABSOLUTE:
case osgParticle::ParticleProcessor::ABSOLUTE_RF:
fw << "ABSOLUTE" << std::endl;
break;
case osgParticle::ParticleProcessor::RELATIVE:
case osgParticle::ParticleProcessor::RELATIVE_RF:
default:
fw << "RELATIVE" << std::endl;
}

View File

@ -468,11 +468,11 @@ void Viewer::setUpViewer(unsigned int options)
lightsource->setLight(light);
if (options & HEAD_LIGHT_SOURCE)
{
lightsource->setReferenceFrame(osg::LightSource::ABSOLUTE); // headlight.
lightsource->setReferenceFrame(osg::LightSource::ABSOLUTE_RF); // headlight.
}
else
{
lightsource->setReferenceFrame(osg::LightSource::RELATIVE); // skylight
lightsource->setReferenceFrame(osg::LightSource::RELATIVE_RF); // skylight
}
lightsource->setLocalStateSetModes(osg::StateAttribute::ON);
}

View File

@ -141,7 +141,7 @@ bool DOFTransform::computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisito
l2w.postMult(getInversePutMatrix());
// finally.
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
matrix.preMult(l2w);
}
@ -209,7 +209,7 @@ bool DOFTransform::computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisito
//and impose inverse put:
w2l.postMult(getPutMatrix());
if (_referenceFrame==RELATIVE)
if (_referenceFrame==RELATIVE_RF)
{
//finally:
matrix.postMult(w2l);

View File

@ -830,7 +830,7 @@ void CullVisitor::apply(LightSource& node)
StateAttribute* light = node.getLight();
if (light)
{
if (node.getReferenceFrame()==osg::LightSource::RELATIVE)
if (node.getReferenceFrame()==osg::LightSource::RELATIVE_RF)
{
RefMatrix& matrix = getModelViewMatrix();
addPositionedAttribute(&matrix,light);

View File

@ -625,7 +625,7 @@ class CollectLowestTransformsVisitor : public osg::NodeVisitor
if (transform)
{
if (transform->getDataVariance()==osg::Transform::DYNAMIC) _moreThanOneMatrixRequired=true;
else if (transform->getReferenceFrame()==osg::Transform::RELATIVE) _moreThanOneMatrixRequired=true;
else if (transform->getReferenceFrame()==osg::Transform::RELATIVE_RF) _moreThanOneMatrixRequired=true;
else
{
if (_transformSet.empty()) transform->computeLocalToWorldMatrix(_firstMatrix,0);