Salome HOME
Revert "Synchronize adm files"
[modules/geom.git] / src / OBJECT / GEOM_Constants.cxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : GEOM_Constants.cxx
24 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25
26 #include "GEOM_Constants.h"
27
28 #include <limits.h>
29
30 namespace GEOM
31 {
32
33   /*!
34     \brief Get minimal allowed value for deflection coefficient
35   */
36   double minDeflection()
37   {
38     return 1e-06; // DEFLECTION_MIN
39   }
40
41   /*!
42     \brief Get character used to separate parameter names
43   */
44   QString sectionSeparator()
45   {
46     return "_"; // NAME_SEPARATOR
47   }
48
49   /*!
50     \brief Get character used to separate numeric parameter values (color = r:g:b)
51   */
52   QString subSectionSeparator()
53   {
54     return ":"; // DIGIT_SEPARATOR
55   }
56   
57   QString propertyName( Property type )
58   {
59     static const char* names[] = {
60       // visibility 
61       "Visibility",      // VISIBILITY_PROP
62       // transparency
63       "Transparency",    // TRANSPARENCY_PROP
64       // display mode
65       "DisplayMode",     // DISPLAY_MODE_PROP
66       // number of the iso lines (along u and v directions)
67       "Isos",            // ISOS_PROP
68       // main / shading color
69       "Color",           // COLOR_PROP
70       // "show edges direction" flag
71       "VectorMode",      // VECTOR_MODE_PROP
72       // deflection coefficient
73       "DeflectionCoeff", // DEFLECTION_COEFF_PROP
74       // point marker data
75       "MarkerType",      // MARKER_TYPE_PROP
76       // material
77       "Material",        // MATERIAL_PROP
78       // general line width
79       "EdgeWidth",       // EDGE_WIDTH_PROP
80       // isos width
81       "IsosWidth",       // ISOS_WIDTH_PROP
82       // top-level flag
83       "TopLevelFlag",    // TOP_LEVEL_PROP
84       // opacity
85       "Opacity",         // OPACITY_PROP
86       // shading color
87       "ShadingColor",    // -
88       // wireframe color
89       "WireframeColor",  // -
90       // standalone edges color
91       "LineColor",       // -
92       // free boundaries color
93       "FreeBndColor",    // -
94       // points color
95       "PointColor",      // -
96       // isos color
97       "IsosColor",       // -
98       // outlines color
99       "OutlineColor",    // -
100       // texture
101       "Texture",         // -
102       // dimensions
103       "Dimensions"       // -
104     };
105     return ( type >= GEOM::Visibility && type <= GEOM::LastProperty ) ? names[type] : QString();
106   }
107
108   /*!
109     \brief Id used for storing properties of objects in study shared between viewers.
110   */
111   int sharedPropertiesId()
112   {
113     return INT_MIN;
114   }
115 } // namespace GEOM