else if (Other.IsWhole()) return Standard_False;
else if (Other.IsVoid()) return Standard_True;
else {
- Bnd_Box2d OtherBox2d = Other; // DownEqual
Standard_Real OXmin,OXmax,OYmin,OYmax;
- OtherBox2d.Get(OXmin,OYmin,OXmax,OYmax);
+ Other.Get(OXmin,OYmin,OXmax,OYmax);
if (!(Flags & XminMask) && (OXmax < (Xmin-Gap))) return Standard_True;
else if (!(Flags & XmaxMask) && (OXmin > (Xmax+Gap))) return Standard_True;
else if (!(Flags & YminMask) && (OYmax < (Ymin-Gap))) return Standard_True;
//! Destructor - must be implemented to release the memory
virtual ~NCollection_BaseCollection (void) {}
+ //! Returns attached allocator
+ const Handle(NCollection_BaseAllocator)& Allocator() const { return myAllocator; }
+
protected:
// --------- PROTECTED METHOD -----------
const Handle(NCollection_BaseAllocator)& IterAllocator(void) const
raises
RangeError from Standard,
OutOfMemory from Standard;
+ ---C++: inline
Create(Item : Array1Item;
Low, Up: Integer from Standard)
-- the Array1.
raises
RangeError from Standard;
+ ---C++: inline
Init (me: in out; V: Array1Item);
---Purpose: Initializes the array with a given value.
+ ---C++: inline
Destroy (me: in out);
---Purpose: Frees the allocated area corresponding to the
-- the Destroy doesn't delete the area.
--
---C++: alias ~
+ ---C++: inline
IsAllocated (me) returns Boolean from Standard;
---Purpose: Returns True if the data was allocated by the array constructors.
// and conditions governing the rights and limitations under the License.
#include <Standard_DimensionMismatch.hxx>
-#include <Standard_RangeError.hxx>
-#include <Standard_OutOfMemory.hxx>
-#include <Standard.hxx>
-// ###### REFERENCER LE STORAGE MANAGER DES COLLECTIONS ######
-
-//=======================================================================
-//function : TCollection_Array1
-//purpose :
-//=======================================================================
-
-TCollection_Array1::TCollection_Array1 (const Standard_Integer Low,
- const Standard_Integer Up) :
- myLowerBound(Low),
- myUpperBound(Up),
- isAllocated(Standard_True)
-{
- Standard_RangeError_Raise_if(Up < Low,"TCollection_Array1::Create");
-
- Array1Item* p = 0;
-#ifdef __OPTIM_ARRAY
- // p = new char [(Up-Low+1)*sizeof (Array1Item)];
- p = (Array1Item *)Standard::Allocate((Up-Low+1)*sizeof (Array1Item));
-#else
- p = new Array1Item[Up-Low+1];
-#endif
-
- if (!p) Standard_OutOfMemory::Raise("Array1 : Allocation failed");
- myStart = (void*)(p - myLowerBound);
-}
-
-
-
-//=======================================================================
-//function : Init
-//purpose :
-//=======================================================================
-
-void TCollection_Array1::Init (const Array1Item& V) {
- Array1Item* p = &ChangeValue(myLowerBound);
- Standard_Integer i;
- for(i = myLowerBound; i <= myUpperBound; i++) {
- *p++ = V;
- }
-}
-
-//=======================================================================
-//function : TCollection_Array1
-//purpose : C Array constructor
-//=======================================================================
-
-TCollection_Array1::TCollection_Array1(const Array1Item& AnItem,
- const Standard_Integer Low,
- const Standard_Integer Up) :
- myLowerBound(Low),
- myUpperBound(Up),
- isAllocated(Standard_False)
-{
-
- Standard_RangeError_Raise_if(Up < Low,"Array1::CArray");
- myStart = (void*)( &AnItem - Low );
-}
-
-//=======================================================================
-//function : Destroy
-//purpose :
-//=======================================================================
-
-void TCollection_Array1::Destroy()
-{
- if (isAllocated) {
-#ifdef __OPTIM_ARRAY
- Standard_Address it = (Standard_Address)&((Array1Item *)myStart)[myLowerBound];
- Standard::Free(it);
-#else
- delete [] &ChangeValue(myLowerBound);
-#endif
- }
-}
//=======================================================================
//function : Assign
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
+#include <Standard.hxx>
+#include <Standard_OutOfMemory.hxx>
#include <Standard_OutOfRange.hxx>
+#include <Standard_RangeError.hxx>
#include Array1Item_hxx
+
+//=======================================================================
+//function : TCollection_Array1
+//purpose :
+//=======================================================================
+
+inline TCollection_Array1::TCollection_Array1 (const Standard_Integer Low,
+ const Standard_Integer Up) :
+ myLowerBound(Low),
+ myUpperBound(Up),
+ isAllocated(Standard_True)
+{
+ Standard_RangeError_Raise_if(Up < Low,"TCollection_Array1::Create");
+
+ Array1Item* p = new Array1Item[Up-Low+1];
+
+ if (!p) Standard_OutOfMemory::Raise("Array1 : Allocation failed");
+ myStart = (void*)(p - myLowerBound);
+}
+
+//=======================================================================
+//function : TCollection_Array1
+//purpose : C Array constructor
+//=======================================================================
+
+inline TCollection_Array1::TCollection_Array1(const Array1Item& AnItem,
+ const Standard_Integer Low,
+ const Standard_Integer Up) :
+ myLowerBound(Low),
+ myUpperBound(Up),
+ isAllocated(Standard_False)
+{
+ Standard_RangeError_Raise_if(Up < Low,"Array1::CArray");
+ myStart = (void*)( &AnItem - Low );
+}
+
+//=======================================================================
+//function : Init
+//purpose :
+//=======================================================================
+
+inline void TCollection_Array1::Init (const Array1Item& V) {
+ Array1Item* p = &ChangeValue(myLowerBound);
+ const Standard_Integer n = Length();
+ for(Standard_Integer i = 0; i < n; i++) {
+ p[i] = V;
+ }
+}
+
+//=======================================================================
+//function : Destroy
+//purpose :
+//=======================================================================
+
+inline void TCollection_Array1::Destroy()
+{
+ if (isAllocated) {
+ delete [] &ChangeValue(myLowerBound);
+ }
+}
+
//=======================================================================
//function : Length
//purpose :
raises
RangeError from Standard,
OutOfMemory from Standard;
+ ---C++: inline
Create (AnArray : Array2)
returns Array2 from TCollection
---Purpose: creates an Array2 by copy of an Array2.
raises OutOfMemory from Standard is private ;
+ ---C++: inline
Create (Item : Array2Item; R1, R2, C1, C2: Integer from Standard)
returns Array2 from TCollection
raises
RangeError from Standard,
OutOfMemory from Standard;
+ ---C++: inline
Init(me : in out; V : Array2Item);
---Purpose: Initializes this array with the value <Value>.
+ ---C++: inline
Destroy (me : in out );
---Level: Advanced
-- DoubleArray the Destroy doesn't delete the area.
--
---C++: alias ~
+ ---C++: inline
Assign (me: in out; Other: Array2)
returns Array2 from TCollection
Standard_RangeError_Raise_if(( RowSize <= 0 || ColumnSize <= 0 ),
"TCollection_Array2::Create");
// Modified by Sergey KHROMOV - Mon Feb 10 11:46:15 2003 End
-#ifdef __OPTIM_ARRAY
- myData = Standard::Allocate(Size*sizeof (Array2Item));
- // myData = (Array2Item *) new char [Size * sizeof (Array2Item)];
-#else
myData = new Array2Item [Size];
-#endif
if (!myData) Standard_OutOfMemory::Raise("Array2 : Allocation failed");
}
myData = (void*) (q - myLowerRow);
}
-//=======================================================================
-//function : TCollection_Array2
-//purpose :
-//=======================================================================
-
-TCollection_Array2::TCollection_Array2 (const Standard_Integer R1,
- const Standard_Integer R2,
- const Standard_Integer C1,
- const Standard_Integer C2) :
- myLowerRow(R1),
- myLowerColumn(C1),
- myUpperRow(R2),
- myUpperColumn(C2),
- myDeletable(Standard_True)
-{
- Allocate ();
-}
-
-//=======================================================================
-//function : TCollection_Array2
-//purpose : User allocated data
-//=======================================================================
-
-TCollection_Array2::TCollection_Array2 (const Array2Item& Item,
- const Standard_Integer R1,
- const Standard_Integer R2,
- const Standard_Integer C1,
- const Standard_Integer C2) :
- myLowerRow(R1),
- myLowerColumn(C1),
- myUpperRow(R2),
- myUpperColumn(C2),
- myDeletable(Standard_False),
- myData((void*)&Item)
-{
- Allocate ();
-}
-
-
-//=======================================================================
-//function : Init
-//purpose :
-//=======================================================================
-
-void TCollection_Array2::Init (const Array2Item& V)
-{
- Standard_Integer Size = RowLength() * ColLength();
- Array2Item* p = &(ChangeValue(myLowerRow,myLowerColumn));
- for (Standard_Integer I = 0; I < Size ; I++) p[I] = V;
-}
-
-//=======================================================================
-//function : Destroy
-//purpose :
-//=======================================================================
-
-void TCollection_Array2::Destroy ()
-{
- Array2Item** anItemPtr = ((Array2Item**)myData + myLowerRow);
-
- // delete the data
- //
- if (myDeletable)
-#ifdef __OPTIM_ARRAY
- {
- Standard_Integer RowSize = myUpperColumn-myLowerColumn+1;
- Standard_Integer ColumnSize = myUpperRow-myLowerRow+1;
- Standard_Integer Size = RowSize * ColumnSize;
- Standard_Address it = (Standard_Address)&((Array2Item **)myData)[myLowerRow][myLowerColumn];
- Standard::Free(it);
- }
-#else
- delete [] &ChangeValue(myLowerRow,myLowerColumn);
-#endif
-
- // delete the indirection table
- Standard::Free((void*&)anItemPtr);
-}
//=======================================================================
//function : Assign
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
+#include <Standard.hxx>
#include <Standard_OutOfRange.hxx>
#include Array2Item_hxx
+//=======================================================================
+//function : TCollection_Array2
+//purpose :
+//=======================================================================
+
+inline TCollection_Array2::TCollection_Array2 (const Standard_Integer R1,
+ const Standard_Integer R2,
+ const Standard_Integer C1,
+ const Standard_Integer C2) :
+ myLowerRow(R1),
+ myLowerColumn(C1),
+ myUpperRow(R2),
+ myUpperColumn(C2),
+ myDeletable(Standard_True)
+{
+ Allocate ();
+}
+
+//=======================================================================
+//function : TCollection_Array2
+//purpose : User allocated data
+//=======================================================================
+
+inline TCollection_Array2::TCollection_Array2 (const Array2Item& Item,
+ const Standard_Integer R1,
+ const Standard_Integer R2,
+ const Standard_Integer C1,
+ const Standard_Integer C2) :
+ myLowerRow(R1),
+ myLowerColumn(C1),
+ myUpperRow(R2),
+ myUpperColumn(C2),
+ myDeletable(Standard_False),
+ myData((void*)&Item)
+{
+ Allocate ();
+}
+
+//=======================================================================
+//function : Init
+//purpose :
+//=======================================================================
+
+inline void TCollection_Array2::Init (const Array2Item& V)
+{
+ Standard_Integer Size = RowLength() * ColLength();
+ Array2Item* p = &(ChangeValue(myLowerRow,myLowerColumn));
+ for (Standard_Integer I = 0; I < Size ; I++) p[I] = V;
+}
+
+//=======================================================================
+//function : Destroy
+//purpose :
+//=======================================================================
+
+inline void TCollection_Array2::Destroy ()
+{
+ Array2Item** anItemPtr = ((Array2Item**)myData + myLowerRow);
+
+ // delete the data
+ //
+ if (myDeletable)
+ delete [] &ChangeValue(myLowerRow,myLowerColumn);
+
+ // delete the indirection table
+ Standard::Free((void*&)anItemPtr);
+}
+
//=======================================================================
//function : ColLength
//purpose :
raises
RangeError from Standard,
OutOfMemory from Standard;
+ ---C++: inline
Create (Low, Up: Integer from Standard; V : ItemHArray1)
returns mutable HArray1 from TCollection
raises
RangeError from Standard,
OutOfMemory from Standard;
+ ---C++: inline
Init(me : mutable; V : ItemHArray1);
---Purpose: Initialize the array with the value <V>
+ ---C++: inline
Length (me) returns Integer from Standard
---Level: Public
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-#include <Standard_OutOfRange.hxx>
-#include <Standard_DimensionMismatch.hxx>
-#include <Standard_RangeError.hxx>
-#include <Standard_OutOfMemory.hxx>
-//=======================================================================
-//function : TCollection_HArray1
-//purpose :
-//=======================================================================
-
-TCollection_HArray1::TCollection_HArray1(const Standard_Integer First,
- const Standard_Integer Last) :
- myArray(First,Last)
-{
-}
-
-//=======================================================================
-//function : TCollection_HArray1
-//purpose :
-//=======================================================================
-TCollection_HArray1::TCollection_HArray1(const Standard_Integer First,
- const Standard_Integer Last,
- const ItemHArray1& V) :
- myArray(First,Last)
-{
- myArray.Init(V);
-}
-
-
-//=======================================================================
-//function : TCollection_HArray1
-//purpose :
-//=======================================================================
-
-void TCollection_HArray1::Init(const ItemHArray1& V)
-{
- myArray.Init(V);
-}
-
// and conditions governing the rights and limitations under the License.
+//=======================================================================
+//function : TCollection_HArray1
+//purpose :
+//=======================================================================
+
+inline TCollection_HArray1::TCollection_HArray1(const Standard_Integer First,
+ const Standard_Integer Last) :
+ myArray(First,Last)
+{
+}
+
//=======================================================================
//function : Length
//purpose :
return myArray.Length();
}
+//=======================================================================
+//function : TCollection_HArray1
+//purpose :
+//=======================================================================
+inline TCollection_HArray1::TCollection_HArray1(const Standard_Integer First,
+ const Standard_Integer Last,
+ const ItemHArray1& V) :
+ myArray(First,Last)
+{
+ myArray.Init(V);
+}
+
+
+//=======================================================================
+//function : Init
+//purpose :
+//=======================================================================
+
+inline void TCollection_HArray1::Init(const ItemHArray1& V)
+{
+ myArray.Init(V);
+}
+
//=======================================================================
//function : Lower
//purpose :
raises
RangeError from Standard,
OutOfMemory from Standard;
+ ---C++: inline
Create (R1, R2, C1, C2: Integer from Standard; V : ItemHArray2)
raises
RangeError from Standard,
OutOfMemory from Standard;
+ ---C++: inline
Init(me : mutable; V : ItemHArray2) ;
---Purpose: Initializes the array with the value <V>
+ ---C++: inline
ColLength (me) returns Integer from Standard
---Purpose: Returns the number of rows of <me>.
is static ;
SetValue (me : mutable; Row, Col: Integer from Standard;
+ ---C++: inline
Value: ItemHArray2)
---Purpose: Assigns the value Value to the (Row,Col) item of this array.
---C++: inline
---Level: Public
---Purpose: Returns the value of the element of index <Row><Col>
---C++: return const &
+ ---C++: inline
raises OutOfRange from Standard
is static;
---Level: Public
---Purpose: Returns the value of the element of index <Row><Col>
---C++: return &
+ ---C++: inline
raises OutOfRange from Standard
is static;
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-#include <Standard_OutOfRange.hxx>
-#include <Standard_DimensionMismatch.hxx>
-#include <Standard_RangeError.hxx>
-#include <Standard_OutOfMemory.hxx>
-
-//=======================================================================
-//function : TCollection_HArray2
-//purpose :
-//=======================================================================
-
-TCollection_HArray2::TCollection_HArray2 (const Standard_Integer R1,
- const Standard_Integer R2,
- const Standard_Integer C1,
- const Standard_Integer C2) :
- myArray(R1,R2,C1,C2)
-{}
-
-
-//=======================================================================
-//function : TCollection_HArray2
-//purpose :
-//=======================================================================
-
-TCollection_HArray2::TCollection_HArray2 (const Standard_Integer R1,
- const Standard_Integer R2,
- const Standard_Integer C1,
- const Standard_Integer C2,
- const ItemHArray2& V) :
- myArray(R1,R2,C1,C2)
-{myArray.Init(V);}
-
-//=======================================================================
-//function : TCollection_HArray2
-//purpose :
-//=======================================================================
-
-void TCollection_HArray2::Init(const ItemHArray2& V)
-{ myArray.Init(V);}
-
//=======================================================================
//function : IsSameState
// }
// return Standard_True;
//}
-
-
-//=======================================================================
-//function : Value
-//purpose :
-//=======================================================================
-
-const ItemHArray2& TCollection_HArray2::Value(const Standard_Integer Row,
- const Standard_Integer Col) const
-{
- return myArray(Row,Col);
-}
-
-//=======================================================================
-//function : ChangeValue
-//purpose :
-//=======================================================================
-
-ItemHArray2& TCollection_HArray2::ChangeValue(const Standard_Integer Row,
- const Standard_Integer Col)
-{
- return myArray(Row,Col);
-}
// and conditions governing the rights and limitations under the License.
+//=======================================================================
+//function : TCollection_HArray2
+//purpose :
+//=======================================================================
+
+inline TCollection_HArray2::TCollection_HArray2 (const Standard_Integer R1,
+ const Standard_Integer R2,
+ const Standard_Integer C1,
+ const Standard_Integer C2) :
+ myArray(R1,R2,C1,C2)
+{}
+
+
+//=======================================================================
+//function : TCollection_HArray2
+//purpose :
+//=======================================================================
+
+inline TCollection_HArray2::TCollection_HArray2 (const Standard_Integer R1,
+ const Standard_Integer R2,
+ const Standard_Integer C1,
+ const Standard_Integer C2,
+ const ItemHArray2& V) :
+ myArray(R1,R2,C1,C2)
+{myArray.Init(V);}
+
+//=======================================================================
+//function : TCollection_HArray2
+//purpose :
+//=======================================================================
+
+inline void TCollection_HArray2::Init(const ItemHArray2& V)
+{ myArray.Init(V);}
+
//=======================================================================
//function : ColLength
//purpose :
myArray.SetValue(Row,Col,Value);
}
+//=======================================================================
+//function : Value
+//purpose :
+//=======================================================================
+
+inline const ItemHArray2& TCollection_HArray2::Value(const Standard_Integer Row,
+ const Standard_Integer Col) const
+{
+ return myArray(Row,Col);
+}
+
+//=======================================================================
+//function : ChangeValue
+//purpose :
+//=======================================================================
+
+inline ItemHArray2& TCollection_HArray2::ChangeValue(const Standard_Integer Row,
+ const Standard_Integer Col)
+{
+ return myArray(Row,Col);
+}
//=======================================================================