~ubuntu-branches/ubuntu/saucy/ifrit/saucy

« back to all changes in this revision

Viewing changes to core/imarker.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2006-10-28 15:06:32 UTC
  • mfrom: (1.1.4 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20061028150632-hyvuhvsv6zpmf5ev
Tags: 3.0.5-1
New upstream version. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Ionization FRont Interactive Tool (IFRIT)
 
4
  Language:  C++
 
5
 
 
6
 
 
7
Copyright (c) 2002-2006 Nick Gnedin 
 
8
All rights reserved.
 
9
 
 
10
This file may be distributed and/or modified under the terms of the
 
11
GNU General Public License version 2 as published by the Free Software
 
12
Foundation and appearing in the file LICENSE.GPL included in the
 
13
packaging of this file.
 
14
 
 
15
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 
16
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
17
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
18
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
 
19
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
20
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
21
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
22
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
23
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
24
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
25
 
 
26
=========================================================================*/
 
27
 
 
28
 
 
29
#ifndef IMARKER_H
 
30
#define IMARKER_H
 
31
 
 
32
 
 
33
#include "isolidviewsubject.h"
 
34
 
 
35
 
 
36
class iCaption;
 
37
class iPointGlyph;
 
38
 
 
39
 
 
40
class iMarker : public iSolidViewSubject 
 
41
{
 
42
        
 
43
        friend class iControlModule;
 
44
 
 
45
public:
 
46
        
 
47
        IOBJECT_DECLARE_SELF(iMarker,iSolidViewSubject);
 
48
 
 
49
        static iMarker* New(iViewModule *vm);
 
50
        virtual ~iMarker();
 
51
        static const iObjectType& Type();
 
52
                
 
53
        IOBJECT_DECLARE_GETSET2(Type,int);
 
54
        //virtual void SetType(int m);
 
55
        //int GetType() const;
 
56
        
 
57
        IOBJECT_DECLARE_GETSET1(CaptionText,const iString&);
 
58
        //virtual void SetCaptionText(const iString &s);
 
59
        //inline iString GetCaptionText() const { return mCaptionText; }
 
60
                
 
61
        IOBJECT_DECLARE_GETSET1(InteractiveMove,bool);
 
62
        //virtual void SetInteractiveMove(bool s);
 
63
        //inline bool GetInteractiveMoveShow() const { return mInteractiveMove; }
 
64
 
 
65
        IOBJECT_DECLARE_GETSET2(Scaled,bool);
 
66
        //virtual void SetScaled(bool s);
 
67
        //bool GetScaled() const;
 
68
 
 
69
        IOBJECT_DECLARE_GETSET(CaptionPosition,mCapPos,const float*);
 
70
        //virtual void SetCaptionPosition(const float *x);
 
71
        //inline const float* GetCaptionPosition() const { return mCapPos; }
 
72
 
 
73
        IOBJECT_DECLARE_GET(ColorAutomatic,mColorAuto,bool);
 
74
        //inline bool isColorAutomatic() const { return mColorAuto; }
 
75
 
 
76
        virtual void SetTextColor(iColor c, bool withAuto = true);
 
77
        IOBJECT_DECLARE_GET(TextColor,mTextColor,iColor);
 
78
        //inline iColor GetTextColor() const { return mTextColor; }
 
79
        
 
80
        IOBJECT_DECLARE_GETSET1(Transform,const float*);
 
81
        //virtual void SetTransform(const float *x);
 
82
        //inline const float* GetTransform() const { return mTransform; }
 
83
 
 
84
        IOBJECT_DECLARE_GETSET_DISTANCE(Size,mSize);
 
85
        //virtual void SetSize(const iDistance &s);
 
86
        //inline const iDistance& GetSize() const { return mSize; }
 
87
        virtual void SetSize(double s);
 
88
 
 
89
        IOBJECT_DECLARE_GETSET_POSITION(Position,mPosition); 
 
90
        //virtual void SetPosition(const iPosition &p);
 
91
        //inline const iPosition& GetPosition() const { return mPosition; }
 
92
 
 
93
        const iString GetTypeAsString() const;
 
94
        static const iObjectKey& KeyTypeAsString();
 
95
 
 
96
        virtual void SetFontScale(int s);
 
97
 
 
98
        void AttachViewSubject(iViewSubject *);
 
99
        void DetachViewSubject(iViewSubject *);
 
100
 
 
101
        inline iPointGlyph* GetMarkerObject() const { return mObject; }
 
102
        inline iCaption* GetMarkerCaption() const { return mCaption; }
 
103
 
 
104
        void Move(const iPosition& p);
 
105
        void FinishMoving();
 
106
 
 
107
        virtual bool IsDataPresent() const { return true; }
 
108
        //
 
109
        //  Inherited members
 
110
        //
 
111
        ISOLIDVIEWSUBJECT_DECLARE_INHERITED_KEYS;
 
112
        ISOLIDVIEWSUBJECT_DECLARE_INHERITED_MEMBERS;
 
113
 
 
114
protected:
 
115
        
 
116
        iMarker(iViewModule *vm);
 
117
        virtual void ConfigureBody(){}
 
118
 
 
119
        virtual void FinishInitialization();
 
120
 
 
121
        //
 
122
        //  VTK stuff
 
123
        //
 
124
        iPointGlyph *mObject;
 
125
        iCaption *mCaption;
 
126
 
 
127
        iDistance mSize;
 
128
        float mCapPos[2], mTransform[6];
 
129
        iColor mTextColor;
 
130
        iString mCaptionText;
 
131
        bool mColorAuto, mInteractiveMove;
 
132
 
 
133
        iSearchableArray<iViewSubject*> mAttachedObjects;
 
134
};
 
135
 
 
136
#endif // IMARKER_H
 
137