VR-Forces 4.0.4 Class Documentation
include/vrvOsg/DtOsgWindowPolygonInstance.h
Go to the documentation of this file.
00001 /****************************************************************************** 
00002 ** Copyright (c) 2009 MAK Technologies, Inc. 
00003 ** All rights reserved. 
00004 ******************************************************************************/ 
00005 /****************************************************************************** 
00006 ** $RCSfile: DtOsgWindowPolygonInstance.h,v $ $Revision: 1.17 $ $State: Exp $ 
00007 ******************************************************************************/ 
00008  
00012  
00013 #ifndef DtOsgWindowPolygonInstance_H_ 
00014 #define DtOsgWindowPolygonInstance_H_ 
00015  
00016 #include <vrvOsg/vrvOsg.h>
00017 #include <vrvCore/DtWindowPolygonInstance.h>
00018 #include <osg/Vec2>
00019 
00020 namespace makVrv 
00021 {
00022    class DtDe;
00023    class DtPolygon;
00024 
00028    class DT_DLL_VRVOSG DtOsgWindowPolygonInstance : public DtWindowPolygonInstance
00029    {
00030    public:
00032       DtOsgWindowPolygonInstance(DtDe& de);
00033 
00035       virtual ~DtOsgWindowPolygonInstance();
00036 
00038       virtual void setVisible(bool isVisible);
00039 
00041       virtual void setFillPattern(unsigned int fillPattern);
00042 
00044       virtual void setScale(double scale);
00045 
00047       virtual void setRotation(double rotation);
00048 
00050       virtual void setNumVertices(unsigned int numVertices);
00051 
00053       virtual void setVertex(int i, double x, double y);
00054 
00056       virtual void setColor(float r,float g,float b,float a);
00057 
00059       virtual void setFill(bool fill);
00060 
00062       virtual const VertexList& vertices() const; 
00063 
00065       virtual bool visible() const;
00066 
00067    protected:
00069       static osg::Vec2 rotate(const osg::Vec2& v, double rad);
00070 
00072       static osg::Vec2 translate( const osg::Vec2& v, const osg::Vec2& translation );
00073 
00075       static osg::Vec2 scale( const osg::Vec2& v, double s );
00076       
00078       virtual void updateVertices();
00079 
00082       void createPolygon();
00083 
00084       DtDe& myDe;
00085       DtPolygon* myPolygon;
00086       VertexList myVertices;
00087       double myRotation;
00088       double myScale;
00089       unsigned int myFillPattern;
00090       float myColorR, myColorG, myColorB, myColorA;
00091       bool myFill;
00092    }; 
00093 } 
00094  
00095 #endif 

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)