COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coRestraint.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef COVISE_RESTRAINT_H
9 #define COVISE_RESTRAINT_H
10 /**************************************************************************\
11  ** **
12  ** **
13  ** Description: Interface classes for application modules to the COVISE **
14  ** software environment **
15  ** **
16  ** **
17  ** **
18  ** **
19  ** **
20  ** (C)1997 RUS **
21  ** Computing Center University of Stuttgart **
22  ** Allmandring 30 **
23  ** 70550 Stuttgart **
24  ** Author: **
25  ** Date: **
26 \**************************************************************************/
27 
28 #include <vector>
29 #include <string>
30 #include <cstdlib>
31 
32 #include "coExport.h"
33 #include "util/coTypes.h"
34 
35 #ifdef WIN32
36 #include <BaseTsd.h>
37 #include <Windows.h>
38 #endif
39 
40 namespace covise
41 {
42 
44 {
45 private:
46  mutable std::vector<ssize_t> values, min, max;
47  mutable bool changed, stringChanged;
49 
50 public:
51  coRestraint();
52  ~coRestraint();
53 
54  void add(ssize_t mi, ssize_t ma);
55  void add(ssize_t val);
56  void add(const char *selection);
57  bool get(ssize_t val, ssize_t &group) const;
58  size_t getNumGroups() const
59  {
60  return min.size();
61  };
62  void clear();
63  const std::vector<ssize_t> &getValues() const;
64  ssize_t lower() const;
65  ssize_t upper() const;
66  const std::string &getRestraintString() const;
67  const std::string getRestraintString(std::vector<ssize_t>) const;
68 
69  // operators
70  bool operator()(ssize_t val) const;
71 };
72 }
73 #endif // COVISE_RESTRAINT_H
std::vector< ssize_t > values
Definition: coRestraint.h:46
Definition: coRestraint.h:43
GLsizei const GLchar *const * string
Definition: khronos-glext.h:6750
GLuint GLfloat * val
Definition: khronos-glext.h:7898
std::string restraintString
Definition: coRestraint.h:48
GLboolean GLuint group
Definition: khronos-glext.h:12389
bool stringChanged
Definition: coRestraint.h:47
#define UTILEXPORT
Definition: coExport.h:182
size_t getNumGroups() const
Definition: coRestraint.h:58
int min(int a, int b)
Definition: cutil_math.h:60
int max(int a, int b)
Definition: cutil_math.h:55