36 boxA =
new te::gm::Envelope(-43.9329795837402, -20.6328010559082, -43.4036407470703, -20.1612071990967);
39 boxB=
new te::gm::Envelope(-43.7329795837402, -20.3328010559082, 10.4036407470703, 10.1612071990967);
41 boxD=
new te::gm::Envelope(-43.8329795837402, -20.4328010559082, -43.6036407470703, -20.2612071990967);
42 boxE=
new te::gm::Envelope(43.9329795837402, -20.6328010559082, 43.4036407470703, -20.1612071990967);
43 boxF=
new te::gm::Envelope(-43.7329795837402, -25.6328010559082, 10.4036407470703, -20.3328010559082);
44 boxG=
new te::gm::Envelope(-43.4036407470703, -20.1612071990967, 25.4036407470703, 10.1612071990967 );
78 CPPUNIT_ASSERT(box->
m_llx == std::numeric_limits<double>::max() );
79 CPPUNIT_ASSERT(box->
m_lly == std::numeric_limits<double>::max() );
80 CPPUNIT_ASSERT(box->
m_urx == -(std::numeric_limits<double>::max() ) );
81 CPPUNIT_ASSERT(box->
m_ury == -(std::numeric_limits<double>::max() ) );
91 CPPUNIT_ASSERT(box->
m_llx == 1.1);
92 CPPUNIT_ASSERT(box->
m_lly == 1.1);
93 CPPUNIT_ASSERT(box->
m_urx == 2.2);
94 CPPUNIT_ASSERT(box->
m_ury == 2.2);
106 CPPUNIT_ASSERT(box.
m_llx == 1.1);
107 CPPUNIT_ASSERT(box.
m_lly == 1.1);
108 CPPUNIT_ASSERT(box.
m_urx == 2.2);
109 CPPUNIT_ASSERT(box.
m_ury == 2.2);
118 box.
init(1.1,1.1,2.2,2.2);
120 CPPUNIT_ASSERT(box.
m_llx == 1.1);
121 CPPUNIT_ASSERT(box.
m_lly == 1.1);
122 CPPUNIT_ASSERT(box.
m_urx == 2.2);
123 CPPUNIT_ASSERT(box.
m_ury == 2.2);
137 box.
init(1.1,1.2,2.1,2.2);
139 CPPUNIT_ASSERT(llx == 1.1);
143 CPPUNIT_ASSERT(llxB == -43.7329795837402);
152 box.
init(1.1,1.2,2.1,2.2);
154 CPPUNIT_ASSERT(lly == 1.2);
158 CPPUNIT_ASSERT(llyB == -20.3328010559082);
167 box.
init(1.1,1.2,2.1,2.2);
169 CPPUNIT_ASSERT(urx == 2.1);
173 CPPUNIT_ASSERT(urxB == 10.4036407470703);
182 box.
init(1.1,1.2,2.1,2.2);
184 CPPUNIT_ASSERT(ury == 2.2);
188 CPPUNIT_ASSERT(uryB == 10.1612071990967);
197 box.
init(1.1,1.2,2.1,2.2);
199 CPPUNIT_ASSERT(llCoord2D.
x == 1.1);
200 CPPUNIT_ASSERT(llCoord2D.
y == 1.2);
209 box.
init(1.1,1.2,2.1,2.2);
211 CPPUNIT_ASSERT(urCoord2D.
x == 2.1);
212 CPPUNIT_ASSERT(urCoord2D.
y == 2.2);
221 box.
init(1.1,1.1,2.2,2.2);
222 CPPUNIT_ASSERT(box.
m_llx == 1.1);
223 CPPUNIT_ASSERT(box.
m_lly == 1.1);
224 CPPUNIT_ASSERT(box.
m_urx == 2.2);
225 CPPUNIT_ASSERT(box.
m_ury == 2.2);
228 CPPUNIT_ASSERT(box.
m_llx == std::numeric_limits<double>::max() );
229 CPPUNIT_ASSERT(box.
m_lly == std::numeric_limits<double>::max() );
230 CPPUNIT_ASSERT(box.
m_urx == -(std::numeric_limits<double>::max()) );
231 CPPUNIT_ASSERT(box.
m_ury == -(std::numeric_limits<double>::max()) );
240 box.
init(1.1,1.2,2.1,2.2);
241 bool isValidRect = box.
isValid();
242 CPPUNIT_ASSERT(isValidRect ==
true);
243 box.
init(2.1,1.2,2.0,2.2);
245 CPPUNIT_ASSERT(isValidRect ==
false);
254 box.
init(1.1,1.1,2.2,2.2);
258 CPPUNIT_ASSERT(width == 1.1);
259 CPPUNIT_ASSERT(right == 1.1);
261 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.21, area, 0.000000001);
345 CPPUNIT_ASSERT_MESSAGE(
"Intersection should be a rectangle ", boxAeB_res.
equals(*
boxAeB) ==
true);
348 bool isLine = (boxAeC.m_llx == boxAeC.m_urx);
349 CPPUNIT_ASSERT_MESSAGE(
"Intersection should be a vertical line ", isLine ==
true);
353 CPPUNIT_ASSERT_MESSAGE(
"Intersection should be a point ", isPoint ==
true);
357 CPPUNIT_ASSERT_MESSAGE(
"Intersection should be a horizontal line ", isLine ==
true);
361 CPPUNIT_ASSERT_MESSAGE(
"Intersection should be a segment of horiz line ", isLine ==
true);
void init(const double &llx, const double &lly, const double &urx, const double &ury)
It initializes (sets) the envelope bounds.
void makeInvalid()
It will invalidated the envelope.
Test suite for the Envelop Class.
void tcMakeInvalid()
Test Case: Invalidate the envelop.
void tcEquals()
Test Case: Check if the envelopes are "spatially equal".
te::gm::Envelope * boxAeF
bool intersects(const Envelope &rhs) const
It returns true if the envelopes "spatially intersects".
void tcContains()
Test Case: Contains.
void tcEnvelopValid()
Test Case: Constructs an envelope with valid coordinates..
void tcGetUpperRightX()
Test Case: Get the lower left X coordinate.
bool touches(const Envelope &rhs) const
It returns true if the envelopes "spatially touches".
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
void tcSpatialOperations()
double m_urx
Upper right corner x-coordinate.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
double getWidth() const
It returns the envelope width.
void tcWithin()
Test Case: Within.
An utility struct for representing 2D coordinates.
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
CPPUNIT_TEST_SUITE_REGISTRATION(TsEnvelop)
void tcEnvelopInit()
Test Case: Initialize a envelop.
void Union(const Envelope &rhs)
It updates the envelop with coordinates of another envelope.
void tcSpatialOperations1()
te::gm::Envelope * boxAEqual
bool disjoint(const Envelope &rhs) const
It returns true if this envelope is "spatially disjoint" from rhs envelope.
double m_llx
Lower left corner x-coordinate.
Test suite for the Envelop class.
An Envelope defines a 2D rectangular region.
bool within(const Envelope &rhs) const
It returns true if this envelope is "spatially within" the rhs envelope.
void tcIntersects()
Test Case: Intersects.
bool contains(const Envelope &rhs) const
It returns true if this envelope "spatially contains" the rhs envelope.
te::gm::Envelope * boxGexpandedA
double getArea() const
It returns the area of this envelope as measured in the spatial reference system of it...
bool equals(const Envelope &rhs) const
It returns true if the envelopes are "spatially equal".
double m_lly
Lower left corner y-coordinate.
void tcEnvelopInvalid()
Test Case: Constructs an envelope with invalid coordinates.
void tcGetLowerLeftCoord2D()
Test Case: Get the lower left Coord2D.
void tcGetUpperRightY()
Test Case: Get the lower left X coordinate.
void tcTouches()
Test Case: Touches.
double m_ury
Upper right corner y-coordinate.
void tcIntersection()
Test Case: Intersection.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
void tcGetLowerLeftX()
Test Case: Get the lower left X coordinate.
te::gm::Envelope * boxAexpandedB
Coord2D getUpperRight() const
It returns the upper right coordinate of the envelope.
void tcEnvelopCopy()
Test Case: Copy a envelop.
Envelope intersection(const Envelope &rhs) const
It returns an envelope that represents the point set intersection with another envelope.
Coord2D getLowerLeft() const
It returns the lower left coordinate of the envelope.
void tcDisjoint()
Test Case: Disjoint.
te::gm::Envelope * boxAeB
double getHeight() const
It returns the envelope height.
bool isValid() const
It tells if the rectangle is valid or not.
void tcGetUpperRightCoord2D()
Test Case: Get the lower left X coordinate.
void tcGetWidth_Right_Area()
void tcUnion()
Test Case: Updates the envelop with another envelop.
void tcGetLowerLeftY()
Test Case: Get the lower left Y coordinate.