VR-Forces 4.0.4 Class Documentation
include/vrvOsg/DtEllipsoidArcModelInstance.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2009 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtEllipsoidArcModelInstance.h,v $ $Revision: 1.0 $ $State: Exp $
00007 ******************************************************************************/
00008 
00012 
00013 #ifndef DtEllipsoidArcModelInstance_H_
00014 #define DtEllipsoidArcModelInstance_H_
00015 
00016 #include <vrvOsg/vrvOsg.h>
00017 #include <vrvOsg/DtOsgModelInstance.h>
00018 
00019 #include <osg/Geode>
00020 #include <osg/MatrixTransform>
00021 
00022 namespace makVrv
00023 {
00026    class DT_DLL_VRVOSG DtEllipsoidArcModelInstance : public DtOsgModelInstance
00027    {
00028    public:
00029 
00030       struct EllipsoidArcParameters
00031       {
00032          float xLength; // diameter along x axis
00033          float yLength; // diameter along y axis
00034          float zLength; // diameter along z axis
00035          double azimuthMin; // display segment of ellipsoid with above this azimuth
00036          double azimuthMax; // display segment of ellipsoid with up to this azimuth
00037          double inclinationMin; // display segment of ellipsoid with above this inclination
00038          double inclinationMax; // display segment of ellipsoid with up to this azimuth
00039          float rColor; // RGBA red value
00040          float gColor; // RGBA green value
00041          float bColor; // RGBA blue value
00042          float aColor; // RGBA alpha value
00043          bool flashing; // Like HTML blink
00044          int maxTriangles; // maximum # of triangles to use
00045       };
00046 
00048       static const EllipsoidArcParameters defaultParameters;
00049 
00050       friend class DtEllipsoidArcModelInstanceCreator;
00051 
00053       virtual ~DtEllipsoidArcModelInstance();
00054 
00056       virtual void setDimensions(double x, double y, double z);
00057 
00059       virtual void setColor(float r,float g,float b,float a);
00060 
00063       virtual bool realize(DtModelDefinition& definition);
00064 
00066       virtual void  addToConnector( DtOsgSceneConnector* connector );
00067 
00069       virtual bool removeFromConnector( DtOsgSceneConnector* connector );
00070 
00072       virtual void setVisible(bool isVisible) {}
00073 
00074    protected:
00076       DtEllipsoidArcModelInstance(DtDe& de);
00077 
00079       virtual void build(const EllipsoidArcParameters& parameters);
00080 
00082       EllipsoidArcParameters myParameters;
00083 
00084       osg::ref_ptr<osg::Geode> myFrontGeode;
00085       osg::ref_ptr<osg::Geode> myBackGeode;
00086       osg::ref_ptr<osg::MatrixTransform> myTransform;
00087    };
00088 
00091    class DT_DLL_VRVOSG DtEllipsoidArcModelInstanceCreator : public DtModelInstanceCreator
00092    {
00093    public:
00094 
00096       static void registerCreator(DtDe& de);
00097 
00099       virtual ~DtEllipsoidArcModelInstanceCreator ();
00100 
00102       virtual DtModelInstance* create(DtDe& de);
00103 
00104    protected:
00105 
00106       DtEllipsoidArcModelInstanceCreator ();
00107    };
00108 }
00109 
00110 #endif
00111 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)