CFx SDK Documentation  2023 SP0
GeUvBox.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2021, 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 Open Design Alliance software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Open Design Alliance Copyright (C) 2002-2021 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 #ifndef _GE_UV_BOX_H_
24 #define _GE_UV_BOX_H_
25 
26 #include "Ge/GeInterval.h"
27 #include "Ge/GeExport.h"
28 #include "Ge/GePoint2d.h"
29 
30 class OdGeExtents2d;
31 
39 struct OdGeUvBox
40 {
45 
49  OdGeUvBox() {}
50 
60  OdGeUvBox(const OdGeInterval& iIntervalU, const OdGeInterval& iIntervalV)
61  {
62  intervals[0] = iIntervalU;
63  intervals[1] = iIntervalV;
64  }
65 
69  const OdGeInterval& u() const { return intervals[0]; }
70 
74  const OdGeInterval& v() const { return intervals[1]; }
75 
79  OdGeInterval& u() { return intervals[0]; }
80 
84  OdGeInterval& v() { return intervals[1]; }
85 
91  const OdGeInterval& operator[](int idx) const { return intervals[idx]; }
92 
98  OdGeInterval& operator[](int idx) { return intervals[idx]; }
99 
107  {
108  intervals[0].set();
109  intervals[1].set();
110  return *this;
111  }
112 
119  OdGeUvBox& set(const OdGeInterval& iIntervalU, const OdGeInterval& iIntervalV)
120  {
121  intervals[0] = iIntervalU;
122  intervals[1] = iIntervalV;
123  return *this;
124  }
125 
138  OdGeUvBox& set(const OdGePoint2d& iLowerBound, const OdGePoint2d& iUpperBound);
139 
149  bool contains(double uparam, double vparam) const;
150 
159  bool contains(const OdGePoint2d& uvpoint) const;
160 
167  bool isBounded() const;
168 
179  bool finiteIntersectWith(const OdGeUvBox& range, OdGeUvBox& result) const;
180 
189  {
190  return OdGePoint2d(u().lowerBound(), v().lowerBound());
191  }
192 
201  {
202  return OdGePoint2d(u().upperBound(), v().upperBound());
203  }
204 
213  bool isEqualTo(const OdGeUvBox& uvbox) const;
214 
225  operator OdGeExtents2d() const;
226 
237  OdGePoint2d eval(double ratioU, double ratioV) const
238  {
239  //GE_NOT_IMPL();
240  OdGePoint2d res/*(u().eval(ratioU), v().eval(ratioV))*/;
241  return res;
242  }
243 
249  OdGePoint2d clamp(const OdGePoint2d &point) const
250  {
251  OdGePoint2d res(u().clamp(point.x), v().clamp(point.y));
252  return res;
253  }
254 };
255 
256 #endif //_GE_UV_BOX_H_
OdGeInterval & set(double lower, double upper)
double x
Definition: GePoint2d.h:299
double y
Definition: GePoint2d.h:300
const GLfloat * v
Definition: gles2_ext.h:315
GLenum GLint * range
Definition: gles2_ext.h:563
const OdGeInterval & u() const
Definition: GeUvBox.h:69
OdGeUvBox & set(const OdGeInterval &iIntervalU, const OdGeInterval &iIntervalV)
Definition: GeUvBox.h:119
const OdGeInterval & v() const
Definition: GeUvBox.h:74
OdGePoint2d upperBound() const
Definition: GeUvBox.h:200
OdGeUvBox & set(const OdGePoint2d &iLowerBound, const OdGePoint2d &iUpperBound)
OdGeInterval intervals[2]
Definition: GeUvBox.h:44
OdGePoint2d clamp(const OdGePoint2d &point) const
Definition: GeUvBox.h:249
const OdGeInterval & operator[](int idx) const
Definition: GeUvBox.h:91
OdGeUvBox()
Definition: GeUvBox.h:49
OdGeUvBox & set()
Definition: GeUvBox.h:106
OdGeInterval & v()
Definition: GeUvBox.h:84
OdGePoint2d lowerBound() const
Definition: GeUvBox.h:188
OdGePoint2d eval(double ratioU, double ratioV) const
Definition: GeUvBox.h:237
bool contains(const OdGePoint2d &uvpoint) const
OdGeInterval & u()
Definition: GeUvBox.h:79
bool contains(double uparam, double vparam) const
bool isBounded() const
bool isEqualTo(const OdGeUvBox &uvbox) const
bool finiteIntersectWith(const OdGeUvBox &range, OdGeUvBox &result) const
OdGeUvBox(const OdGeInterval &iIntervalU, const OdGeInterval &iIntervalV)
Definition: GeUvBox.h:60
OdGeInterval & operator[](int idx)
Definition: GeUvBox.h:98