From 9415f669e852b1eb420d2e49eb97dbcb3ef675c7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 16 Nov 2005 16:30:51 +0000 Subject: [PATCH] Converted remaining osg::Matrix usage to osg::Matrixd. --- src/osgPlugins/dxf/dxfEntity.cpp | 12 ++++++------ src/osgPlugins/dxf/dxfEntity.h | 6 +++--- src/osgPlugins/dxf/scene.cpp | 2 +- src/osgPlugins/dxf/scene.h | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/osgPlugins/dxf/dxfEntity.cpp b/src/osgPlugins/dxf/dxfEntity.cpp index 419c00a6b..bf5fa56a9 100644 --- a/src/osgPlugins/dxf/dxfEntity.cpp +++ b/src/osgPlugins/dxf/dxfEntity.cpp @@ -164,7 +164,7 @@ dxfCircle::assign(dxfFile* dxf, codeValue& cv) void dxfCircle::drawScene(scene* sc) { - Matrix m; + Matrixd m; getOCSMatrix(_ocs, m); sc->ocs(m); std::vector vlist; @@ -235,7 +235,7 @@ dxfArc::assign(dxfFile* dxf, codeValue& cv) void dxfArc::drawScene(scene* sc) { - Matrix m; + Matrixd m; getOCSMatrix(_ocs, m); sc->ocs(m); std::vector vlist; @@ -313,7 +313,7 @@ dxfLine::assign(dxfFile* dxf, codeValue& cv) void dxfLine::drawScene(scene* sc) { - Matrix m; + Matrixd m; getOCSMatrix(_ocs, m); // don't know why this doesn't work // sc->ocs(m); @@ -395,7 +395,7 @@ dxfPolyline::drawScene(scene* sc) { // if (getLayer() != "UDF2" && getLayer() != "ENGINES") return; // if (!(_flag & 16)) return; - Matrix m; + Matrixd m; getOCSMatrix(_ocs, m); sc->ocs(m); std::vector vlist; @@ -648,7 +648,7 @@ dxfLWPolyline::drawScene(scene* sc) { // if (getLayer() != "UDF2" && getLayer() != "ENGINES") return; // if (!(_flag & 16)) return; - Matrix m; + Matrixd m; getOCSMatrix(_ocs, m); sc->ocs(m); if (_flag & 1) { @@ -732,7 +732,7 @@ dxfInsert::drawScene(scene* sc) sc->pushMatrix(Matrixd::rotate(osg::DegreesToRadians(_rotation), 0,0,1)); } sc->pushMatrix(Matrixd::scale(_scale.x(), _scale.y(), _scale.z())); - sc->pushMatrix(Matrix::translate(_point.x(), _point.y(), _point.z())); + sc->pushMatrix(Matrixd::translate(_point.x(), _point.y(), _point.z())); getOCSMatrix(_ocs, m); sc->pushMatrix(m); sc->pushMatrix(back); diff --git a/src/osgPlugins/dxf/dxfEntity.h b/src/osgPlugins/dxf/dxfEntity.h index 1c92968bd..95787f5ca 100644 --- a/src/osgPlugins/dxf/dxfEntity.h +++ b/src/osgPlugins/dxf/dxfEntity.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "dxfBlock.h" @@ -33,7 +33,7 @@ class codeValue; class dxfFile; static inline void -getOCSMatrix(osg::Vec3d ocs, osg::Matrix &m) +getOCSMatrix(const osg::Vec3d& ocs, osg::Matrixd& m) { static const double one_64th = 1.0/64.0; m.makeIdentity(); @@ -49,7 +49,7 @@ getOCSMatrix(osg::Vec3d ocs, osg::Matrix &m) ax.normalize(); ay = ocsaxis ^ ax; ay.normalize(); - m = osg::Matrix( ax.x(), ax.y(), ax.z(), 0, + m = osg::Matrixd( ax.x(), ax.y(), ax.z(), 0, ay.x(), ay.y(), ay.z(), 0, ocsaxis.x(), ocsaxis.y(), ocsaxis.z(), 0, 0,0,0,1); diff --git a/src/osgPlugins/dxf/scene.cpp b/src/osgPlugins/dxf/scene.cpp index b2e2739b5..69ef65a61 100644 --- a/src/osgPlugins/dxf/scene.cpp +++ b/src/osgPlugins/dxf/scene.cpp @@ -38,7 +38,7 @@ Vec3d scene::addVertex(Vec3d v) { v += _t; v = preMultd(_r, v); - osg::Matrixd m = osg::Matrix::translate(v.x(), v.y(), v.z()); + osg::Matrixd m = osg::Matrixd::translate(v.x(), v.y(), v.z()); m = m * _m; Vec3d a = preMultd(m, Vec3d(0,0,0)); _b.expandBy(a); diff --git a/src/osgPlugins/dxf/scene.h b/src/osgPlugins/dxf/scene.h index b2fd231c1..188b648be 100644 --- a/src/osgPlugins/dxf/scene.h +++ b/src/osgPlugins/dxf/scene.h @@ -19,7 +19,7 @@ #ifndef DXF_SCENE #define DXF_SCENE 1 -#include +#include #include #include #include @@ -243,7 +243,7 @@ public: scene(dxfLayerTable* lt = NULL); virtual ~scene() {} void setLayerTable(dxfLayerTable* lt); - void pushMatrix(osg::Matrixd m, bool protect = false) + void pushMatrix(const osg::Matrixd& m, bool protect = false) { _mStack.push_back(_m); if (protect) // equivalent to setMatrix @@ -259,11 +259,11 @@ public: else _m.makeIdentity(); } - void ocs(osg::Matrixd r) + void ocs(const osg::Matrixd& r) { _r = r; } - void blockOffset(osg::Vec3d t) + void blockOffset(const osg::Vec3d& t) { _t = t; } @@ -300,10 +300,10 @@ public: double x = _b._min.x() - (double)v.x(); double y = _b._min.y() - (double)v.y(); double z = _b._min.z() - (double)v.z(); - osg::Matrix m = osg::Matrix::translate(v); + osg::Matrixd m = osg::Matrixd::translate(v); root = new osg::MatrixTransform(m); if (x || y || z) { - m = osg::Matrix::translate(x,y,z); + m = osg::Matrixd::translate(x,y,z); child = new osg::MatrixTransform(m); root->addChild(child); } else {