OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofeggraphiccontext.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 
36 #ifndef oofeggraphiccontext_h
37 #define oofeggraphiccontext_h
38 
39 #include "oofemcfg.h"
40 #include "intarray.h"
41 #include "internalstatemode.h"
42 #include "internalstatetype.h"
43 
44 #include <list>
45 
46 //
47 // for c++ compiler to be successful on some c files
48 //
49 
50 extern "C" {
51  #define new __new
52  #define class __class
53  #define inline __inline
54  #define min __min
55  #define max __max
56  #define sgn __sgn
57  #define macbra __macbra
58  #define Status __Status
59  #define Request __Request
60  #define Complex __Complex
61 
62  #include <Esimple.h>
63 
64  #undef new
65  #undef class
66  #undef inline
67  #undef min
68  #undef max
69  #undef sgn
70  #undef macbra
71  #undef Status
72  #undef Request
73  #undef PI
74  #undef Complex
75  #undef None
76 };
77 
78 
79 
80 // not declared in any *.h Elixir file
81 
82 extern "C" {
83  void EVFastRedraw(EView *v_p);
84 };
85 
86 namespace oofem {
87 // width definition variables
88  #define OOFEG_RAW_GEOMETRY_WIDTH 0
89  #define OOFEG_DEFORMED_GEOMETRY_WIDTH 0
90  #define OOFEG_CRACK_PATTERN_WIDTH 2
91  #define OOFEG_ISO_LINE_WIDTH 4
92  #define OOFEG_SPARSE_PROFILE_WIDTH 0
93 
94 // layer definition variables
95  #define OOFEG_RAW_GEOMETRY_LAYER 0
96  #define OOFEG_DEFORMED_GEOMETRY_LAYER 1
97  #define OOFEG_NODE_ANNOTATION_LAYER 2
98  #define OOFEG_ELEMENT_ANNOTATION_LAYER 3
99  #define OOFEG_VARPLOT_PATTERN_LAYER 4
100  #define OOFEG_CRACK_PATTERN_LAYER 5
101  #define OOFEG_BCIC_ANNOTATION_LAYER 6
102  #define OOFEG_NATURALBC_LAYER 7
103  #define OOFEG_SPARSE_PROFILE_LAYER 8
104  #define OOFEG_DEBUG_LAYER 9
105  #define OOFEG_RAW_CROSSSECTION_LAYER 10
106  #define OOFEG_LAST_LAYER 11
107 class EngngModel;
108 class Element;
109 class Range;
110 
117 };
118 
119 
123 
124  #define OOFEG_YIELD_STEPS 3
125 
126 class OOFEM_EXPORT oofegGraphicContext
127 {
128 protected:
129 
130  /*
131  * Common members to all contexts
132  */
134  static EFringeTable ft;
135 
136  static EPixel meshFillColor;
137  static EPixel remoteMeshFillColor;
138  static EPixel edgeColor;
139  static EPixel remoteEdgeColor;
140 
141  static EPixel nodeColor;
142  static EPixel bcicColor;
143  static EPixel bcForceColor;
144  static EPixel deformedElementColor;
145  static EPixel crackPatternColor;
146  static EPixel activeCrackColor;
147  static EPixel yieldPlotColors [ OOFEG_YIELD_STEPS ];
148  static EPixel standardSparseProfileColor, extendedSparseProfileColor;
149  static EPixel geometryColor;
150  static EPixel crossSectionColor;
151 
152  static int activeStep, activeStepVersion;
153  static double defScale;
154  static double zprofilescale; // for landscape plots in 2d
155  static int activeEigVal;
156  static int activeYieldStep;
157 
158  // Material Model (region) filter
160 
161  // element filter
162  static std :: list< Range >element_filter;
163 
165  // smoother type
167 
168  // deformed geometry internal variables plot flag
169  // nonzero indicate to use deformed shape
170  static int intVarDefGeoFlag;
171 
172  // Sparse matrix profile mode (1=marker mode, 0=grid mode)
173  static int sparseProfileMode;
174 
175  // EFringeTable ft;
176  static int activeProblem;
177  static int activeDomain;
178 
179  // scale mode and color scale values
180  static ScaleMode smode;
181  static double emin, emax;
182  static int scaleInitFlag;
183 
184  static bool staticVarsInitFlag;
185 
186  // mode of value
188 
189  /*
190  * Attributes
191  */
192  // current value to display
194  // component of value
196  // plot mode (scalar, vector, tensor plot)
198  // on/off flag
200 
201 public:
204 
205  void init(EngngModel *);
206 
207 
208  EPixel getElementColor() { return meshFillColor; }
209  EPixel getElementEdgeColor() { return edgeColor; }
210  EPixel getRemoteElementColor() { return remoteMeshFillColor; }
211  EPixel getRemoteElementEdgeColor() { return remoteEdgeColor; }
212  EPixel getNodeColor() { return nodeColor; }
213  EPixel getBcIcColor() { return bcicColor; }
214  EPixel getBcForceColor() { return bcForceColor; }
215  EPixel getDeformedElementColor() { return deformedElementColor; }
216  EPixel getCrackPatternColor() { return crackPatternColor; }
217  EPixel getActiveCrackColor() { return activeCrackColor; }
218  EPixel getYieldPlotColor(double ratio)
219  { return this->GR_giveColorFromUserColorTable(yieldPlotColors, OOFEG_YIELD_STEPS, ratio); }
220  EPixel getCrossSectionColor() { return crossSectionColor; }
221  EPixel getStandardSparseProfileColor() { return standardSparseProfileColor; }
222  EPixel getExtendedSparseProfileColor() { return extendedSparseProfileColor; }
223  EPixel getGeometryColor() { return geometryColor; }
224  int getSparseProfileMode() { return sparseProfileMode; }
225 
226 
227  // DrawMode getDrawMode () {return mode;}
228  // EFringeTable getFringeTable () {return ft;}
229  int getActiveStep() { return activeStep; }
230  int getActiveStepVersion() { return activeStepVersion; }
231  double getDefScale() { return defScale; }
232  double getLandScale() { return zprofilescale; }
233  int getActiveEigVal() { return activeEigVal; }
234  int getActiveYieldStep() { return activeYieldStep; }
235  int getInternalVarsDefGeoFlag() { return intVarDefGeoFlag; }
236  int getActiveDomain() { return activeDomain; }
237  int getActiveProblemIndx() { return activeProblem; }
238  EngngModel *getActiveProblem();
239  EFringeTable getFringeTable() { return ft; }
240 
241  void setElementColor(EPixel color) { meshFillColor = color; }
242  void setElementEdgeColor(EPixel color) { edgeColor = color; }
243  void setNodeColor(EPixel color) { nodeColor = color; }
244  void setDeformedElementColor(EPixel color) { deformedElementColor = color; }
245  void setCrackPatternColor(EPixel color) { crackPatternColor = color; }
246  void setActiveCrackColor(EPixel color) { activeCrackColor = color; }
247  void setGeometryColor(EPixel color) { geometryColor = color; }
248  void setCrossSectionColor(EPixel color) { crossSectionColor = color; }
249  void setActiveStep(int n) { activeStep = n; }
250  void setActiveStepVersion(int n) { activeStepVersion = n; }
251  void setDefScale(double n) { defScale = n; }
252  void setLandScale(double n) { zprofilescale = n; }
253  void setActiveEigVal(int n) { activeEigVal = n; }
254  void setActiveYieldStep(int n) { activeYieldStep = n; }
255  void setInternalVarsDefGeoFlag(int n) { intVarDefGeoFlag = n; }
256  void setSparseProfileMode(int n) { sparseProfileMode = n; }
257  int setActiveDomain(int a) {
258  activeDomain = a;
259  return activeDomain;
260  }
261  int setActiveProblem(int a);
262 
263  void setPlotMode(OGC_PlotModeType mode) { plotMode = mode; }
264  void setInternalStateMode(InternalStateMode mode) { varMode = mode; }
265  void setInternalStateType(InternalStateType type) { varType = type; }
266  void setIntVarIndx(int indx) { component = indx; }
267  InternalStateType giveIntVarType() { return this->varType; }
268  InternalStateMode giveIntVarMode() { return this->varMode; }
269  OGC_PlotModeType giveIntVarPlotMode() { return this->plotMode; }
270  int giveIntVarIndx() { return this->component; }
271 
272  ScalarAlgorithmType getScalarAlgo() { return scalarAlgo; }
273  void setScalarAlgo(ScalarAlgorithmType a) { scalarAlgo = a; }
274 
275  SmootherType giveSmootherType() { return smootherType; }
276  void setSmootherType(SmootherType type) { this->smootherType = type; }
277 
278  ScaleMode getScaleMode() { return smode; }
279  void setScaleMode(ScaleMode s) { smode = s; }
280  double getScaleMin() { return emin; }
281  double getScaleMax() { return emax; }
282  void setScaleVals(double smin, double smax) {
283  emin = smin;
284  emax = smax;
285  }
286  void resetScaleVals() {
287  if ( smode == SM_Autoscale ) {
288  scaleInitFlag = 1;
289  emin = 1.0;
290  emax = -1.0;
291  }
292  }
293  void updateFringeTableMinMax(double *s, int size);
294 
295  // component filters
296  // element filter
301  int testElementGraphicActivity(Element *);
305  int getMaterialModelFilterState(int i);
309  void setMaterialModelFilterState(int i, int state);
314  void setElementFilterState(char *initString);
315 
317  bool isActive() { return this->isActiveFlag; }
319  void setActivityFlag(bool flag) { isActiveFlag = flag; }
320 
321 
322 protected:
323  EPixel GR_giveColorFromUserColorTable(EPixel *table, int tableSize, double relVal);
324  // void GR_setupUserColors ();
325  // void GR_deleteUserColorTables();
326 };
327 } // end namespace oofem
328 
329 /* these reside in global name space */
331 extern EView *myview;
332 extern void deleteLayerGraphics(int iLayer);
333 
334 #endif // oofeggraphiccontext_h
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
ScalarAlgorithmType getScalarAlgo()
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
void setElementColor(EPixel color)
Abstract base class for all finite elements.
Definition: element.h:145
void setElementEdgeColor(EPixel color)
Class implementing an array of integers.
Definition: intarray.h:61
void setSmootherType(SmootherType type)
#define OOFEG_YIELD_STEPS
EPixel getYieldPlotColor(double ratio)
static std::list< Range > element_filter
InternalStateType giveIntVarType()
void setActiveCrackColor(EPixel color)
static ScalarAlgorithmType scalarAlgo
void setInternalStateType(InternalStateType type)
void setPlotMode(OGC_PlotModeType mode)
void setCrackPatternColor(EPixel color)
static SmootherType smootherType
static InternalStateMode varMode
void setScalarAlgo(ScalarAlgorithmType a)
InternalStateMode giveIntVarMode()
void EVFastRedraw(EView *v_p)
EView * myview
#define OOFEG_LAST_LAYER
void setScaleVals(double smin, double smax)
void setActivityFlag(bool flag)
sets activity flag
void setCrossSectionColor(EPixel color)
void deleteLayerGraphics(int iLayer)
bool isActive()
tests if context is active
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
void setDeformedElementColor(EPixel color)
the oofem namespace is to define a context or scope in which all oofem names are defined.
void setInternalStateMode(InternalStateMode mode)
void setGeometryColor(EPixel color)
InternalStateMode
Determines the mode of internal variable.
OGC_PlotModeType giveIntVarPlotMode()

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011