summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/pmgraphicalobject.h
blob: 662f7682eea45fef7ed2da5e30c2a674255392f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//-*-C++-*-
/*
**************************************************************************
                                 description
                             --------------------
    copyright            : (C) 2000-2002 by Andreas Zehender
    email                : zehender@kde.org
**************************************************************************

**************************************************************************
*                                                                        *
*  This program is free software; you can redistribute it and/or modify  *
*  it under the terms of the GNU General Public License as published by  *
*  the Free Software Foundation; either version 2 of the License, or     *
*  (at your option) any later version.                                   *
*                                                                        *
**************************************************************************/


#ifndef PMGRAPHICALOBJECT_H
#define PMGRAPHICALOBJECT_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "pmdetailobject.h"


/**
 * Class for povray graphical objects
 *
 * Objects in povray can be:
 * Finite Solid Primitives, Finite Patch Primitives, Infinite Solid Primitives and Constructive Solid Geometry
 */
class PMGraphicalObject : public PMDetailObject
{
   typedef PMDetailObject Base;
public:
   /**
    * Creates an empty PMGraphicalObject
    */
   PMGraphicalObject( PMPart* part );
   /**
    * Copy constructor
    */
   PMGraphicalObject( const PMGraphicalObject& o );
   /**
    * Deletes the object and all tqchildren
    */
   virtual ~PMGraphicalObject( );

   /** */
   virtual PMMetaObject* tqmetaObject( ) const;
   /** */
   virtual void cleanUp( ) const;

   /** */
   virtual void serialize( TQDomElement& e, TQDomDocument& doc ) const;
   /** */
   virtual void readAttributes( const PMXMLHelper& h );

   /**
    * Returns the state of the no_shadow flag.
    */
   bool noShadow( ) const { return m_noShadow; }
   /**
    * Sets the no_shadow flag
    */
   void setNoShadow( bool yes );
   /**
    * Returns the state of the no_image flag.
    */
   bool noImage( ) const { return m_noImage; }
   /**
    * Sets the no_image flag
    */
   void setNoImage( bool yes );
   /**
    * Returns the state of the no_reflection flag
    */
   bool noReflection( ) const { return m_noReflection; }
   /**
    * Sets the no_reflection flag
    */
   void setNoReflection( bool yes );
   /**
    * Returns the state of the double_illuminate flag
    */
   bool doubleIlluminate( ) const { return m_doubleIlluminate; }
   /**
    * Sets the double_illuminate flag
    */
   void setDoubleIlluminate( bool yes );
   /**
    * Returns the visibility level
    */
   int visibilityLevel( ) const { return m_visibilityLevel; }
   /**
    * Sets the visibility level
    */
   void setVisibilityLevel( int level );
   /**
    * Returns true if the visibility level is relative to the objects tqparent
    */
   bool isVisibilityLevelRelative( ) const { return m_relativeVisibility; }
   /**
    * Sets the visibility level absolute or relative
    */
   void setVisibilityLevelRelative( bool relative );
   /**
    * Returns the export flag
    */
   virtual bool exportPovray( ) const { return m_export; }
   /**
    * Sets the export flag
    */
   void setExportPovray( bool ex );

   /** */
   virtual void restoreMemento( PMMemento* s );
private:
   /**
    * IDs for @ref PMMementoData
    */
   enum PMGraphicalObjectMementoID { PMNoShadowID, PMNoImageID, PMNoReflectionID,
                                     PMDoubleIlluminateID, PMVisibilityID,
                                     PMRelativeVisibilityID, PMExportID };

   bool m_noShadow;
   bool m_noImage;
   bool m_noReflection;
   bool m_doubleIlluminate;
   int m_visibilityLevel;
   bool m_relativeVisibility;
   bool m_export;
   static PMMetaObject* s_pMetaObject;
};


#endif