CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GeUvBox.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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
30class OdGeExtents2d;
31
40{
44 OdGeInterval intervals[2];
45
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 OdGePoint2d res(u().eval(ratioU), v().eval(ratioV));
240 return res;
241 }
242
248 OdGePoint2d clamp(const OdGePoint2d &point) const
249 {
250 OdGePoint2d res(u().clamp(point.x), v().clamp(point.y));
251 return res;
252 }
253};
254
255#endif //_GE_UV_BOX_H_
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
OdGeInterval & set(double lower, double upper)
Definition: GeInterval.h:196
double x
Definition: GePoint2d.h:409
double y
Definition: GePoint2d.h:410
const GLfloat * v
Definition: gles2_ext.h:315
GLenum GLint * range
Definition: gles2_ext.h:563
OdGePoint2d upperBound() const
Definition: GeUvBox.h:200
OdGePoint2d clamp(const OdGePoint2d &point) const
Definition: GeUvBox.h:248
OdGeUvBox & set()
Definition: GeUvBox.h:106
OdGeUvBox()
Definition: GeUvBox.h:49
OdGeInterval & operator[](int idx)
Definition: GeUvBox.h:98
OdGeInterval & v()
Definition: GeUvBox.h:84
OdGePoint2d lowerBound() const
Definition: GeUvBox.h:188
OdGePoint2d eval(double ratioU, double ratioV) const
Definition: GeUvBox.h:237
const OdGeInterval & operator[](int idx) const
Definition: GeUvBox.h:91
bool contains(const OdGePoint2d &uvpoint) const
OdGeUvBox & set(const OdGeInterval &iIntervalU, const OdGeInterval &iIntervalV)
Definition: GeUvBox.h:119
const OdGeInterval & v() const
Definition: GeUvBox.h:74
OdGeUvBox & set(const OdGePoint2d &iLowerBound, const OdGePoint2d &iUpperBound)
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
const OdGeInterval & u() const
Definition: GeUvBox.h:69