CFx SDK Documentation  2023 SP0
GeInterval.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 #ifndef OD_GE_INTERVAL_H
26 #define OD_GE_INTERVAL_H
28 #include "Ge/GeExport.h"
29 #include "TD_PackPush.h"
30 
40 {
41 public:
53  double tol = 1.e-12);
55  double lower,
56  double upper,
57  double tol = 1.e-12);
59  bool boundedBelow,
60  double bound,
61  double tol = 1.e-12);
62 
64 
71  double lowerBound() const;
72 
79  double upperBound() const;
80 
93  double element() const;
94 
101  void getBounds(
102  double& lower,
103  double& upper) const;
104 
111  double length() const;
112 
116  double tolerance() const;
117 
128  double lower,
129  double upper);
130 
142  bool boundedBelow,
143  double bound);
144 
152 
160  double upper);
161 
170  double lower);
171 
181  double tol);
182 
189  void getMerge(
190  const OdGeInterval& otherInterval,
191  OdGeInterval& result) const;
192 
210  int subtract(
211  const OdGeInterval& otherInterval,
212  OdGeInterval& lInterval,
213  OdGeInterval& rInterval) const;
214 
225  const OdGeInterval& otherInterval,
226  OdGeInterval& result) const;
227 
231  bool isBounded() const;
232 
236  bool isBoundedAbove() const;
237 
241  bool isBoundedBelow() const;
242 
246  bool isUnBounded() const;
247 
253  bool isSingleton() const;
254 
263  const OdGeInterval& otherInterval) const;
264 
273  bool contains(
274  const OdGeInterval& otherInterval) const;
275  bool contains(
276  double value) const;
277 
287  const OdGeInterval& otherInterval) const;
288 
307  const OdGeInterval& otherInterval,
308  OdGeInterval& overlap) const;
309 
311  const OdGeInterval& otherInterval) const;
313  const OdGeInterval& otherInterval) const;
314 
327  const OdGeInterval& otherInterval) const;
328 
340  double value) const;
341 
353  const OdGeInterval& otherInterval) const;
354 
365  double value) const;
366 
380  double period,
381  double& value);
382 
383 //FELIX_CHANGE_BEGIN
384 //merge from ODA main
394  bool finiteIntersectWith(const OdGeInterval& range, OdGeInterval& result) const;
395 
402  double middle() const {
403  return 0.5 * (m_LowerParam + m_UpperParam);
404  }
405 
413  double clamp(
414  double value) const
415  {
416  if (m_bBoundedAbove)
417  value = odmin(value, m_UpperParam);
418  if (m_bBoundedBelow)
419  value = odmax(value, m_LowerParam);
420  return value;
421  }
422 
429  double eval(
430  double ratio) const
431  {
432  ODA_ASSERT(isBounded());
433  return m_LowerParam * (1.0 - ratio) + m_UpperParam * ratio;
434  }
435 
436  double getEnd(
437  int index) const
438  {
439  ODA_ASSERT(index == 0 || index == 1);
440  return index == 0 ? m_LowerParam : m_UpperParam;
441  }
442 //FELIX_CHANGE_END
443 
444  friend
446  double value,
447  const OdGeInterval& interval);
449  double value) const;
451  const OdGeInterval& otherInterval) const;
452  friend
454  double value,
455  const OdGeInterval& interval);
457  double value) const;
459  const OdGeInterval& otherInterval) const;
460  friend
462  double value,
463  const OdGeInterval& interval);
465  double value) const;
467  const OdGeInterval& otherInterval) const;
468  friend
470  double value,
471  const OdGeInterval& interval);
473  double value) const;
475  const OdGeInterval& otherInterval) const;
476 
477 private:
478  double m_Tol;
479  double m_UpperParam;
480  double m_LowerParam;
481  bool m_bBoundedAbove;
482  bool m_bBoundedBelow;
483 };
484 
485 #include "TD_PackPop.h"
486 #endif // OD_GE_INTERVAL_H
487 
#define ODA_ASSERT(exp)
Definition: DebugStuff.h:49
tol
Definition: DimVarDefs.h:2287
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
#define odmin(X, Y)
Definition: OdPlatform.h:34
#define odmax(X, Y)
Definition: OdPlatform.h:35
bool operator>=(const OdString &s1, const OdString &s2)
Definition: OdString.h:1351
bool operator<=(const OdString &s1, const OdString &s2)
Definition: OdString.h:1329
bool operator<(const OdString &s1, const OdString &s2)
Definition: OdString.h:1284
bool operator>(const OdString &s1, const OdString &s2)
Definition: OdString.h:1307
OdGeInterval(double tol=1.e-12)
OdGeInterval(bool boundedBelow, double bound, double tol=1.e-12)
double upperBound() const
bool isEqualAtUpper(double value) const
bool contains(const OdGeInterval &otherInterval) const
void getBounds(double &lower, double &upper) const
double getEnd(int index) const
Definition: GeInterval.h:436
double middle() const
Definition: GeInterval.h:402
OdGeInterval & setTolerance(double tol)
OdGeInterval & set()
OdGeInterval & set(double lower, double upper)
bool isEqualAtUpper(const OdGeInterval &otherInterval) const
bool isSingleton() const
OdGeInterval & set(bool boundedBelow, double bound)
bool isOverlapAtUpper(const OdGeInterval &otherInterval, OdGeInterval &overlap) const
double lowerBound() const
bool isBoundedBelow() const
bool isPeriodicallyOn(double period, double &value)
double clamp(double value) const
Definition: GeInterval.h:413
double tolerance() const
OdGeInterval(double lower, double upper, double tol=1.e-12)
double eval(double ratio) const
Definition: GeInterval.h:429
bool contains(double value) const
bool isEqualAtLower(double value) const
bool intersectWith(const OdGeInterval &otherInterval, OdGeInterval &result) const
bool isUnBounded() const
bool isBounded() const
bool isDisjoint(const OdGeInterval &otherInterval) const
bool isBoundedAbove() const
void getMerge(const OdGeInterval &otherInterval, OdGeInterval &result) const
OdGeInterval & setLower(double lower)
bool isEqualAtLower(const OdGeInterval &otherInterval) const
bool finiteIntersectWith(const OdGeInterval &range, OdGeInterval &result) const
double element() const
OdGeInterval & setUpper(double upper)
int subtract(const OdGeInterval &otherInterval, OdGeInterval &lInterval, OdGeInterval &rInterval) const
bool isContinuousAtUpper(const OdGeInterval &otherInterval) const
double length() const
GLuint index
Definition: gles2_ext.h:265
GLenum GLint * range
Definition: gles2_ext.h:563
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
bool operator==(const BlockRefPath &rA, const BlockRefPath &rB)
DOM.
bool operator!=(const BlockRefPath &rA, const BlockRefPath &rB)
DOM.