diff --git a/src/BOPTColStd/BOPTColStd_CArray1.cdl b/src/BOPTColStd/BOPTColStd_CArray1.cdl index 8de3aff957..8a7ae4a6ed 100755 --- a/src/BOPTColStd/BOPTColStd_CArray1.cdl +++ b/src/BOPTColStd/BOPTColStd_CArray1.cdl @@ -31,7 +31,8 @@ is ---Purpose: -- Prohibits the creator by copy -- - Assign (me:out; Other : CArray1 from BOPTColStd) + Assign (me:out; Other : + CArray1 from BOPTColStd) returns CArray1 from BOPTColStd is private; ---C++: alias operator = @@ -39,7 +40,8 @@ is ---Purpose: -- Prohibits the operator = -- - Resize(me: in out; theNewLength: Integer from Standard); + Resize(me: in out; + theNewLength: Integer from Standard); ---Purpose: -- destroy current content and realloc the new size -- @@ -49,30 +51,37 @@ is -- Frees the allocated area corresponding to the -- array. -- - Length (me) returns Integer from Standard; + Length (me) + returns Integer from Standard; ---Purpose: -- Returns the number of elements of -- - Extent (me) returns Integer from Standard; + Extent (me) + returns Integer from Standard; ---Purpose: -- The same as Length(). --- - FactLength (me) returns Integer from Standard; + FactLength (me) + returns Integer from Standard; ---Purpose: -- Returns the number of elements of . --- - Append (me:out; Value: Array1Item) + Append (me:out; + Value: Array1Item) returns Integer from Standard raises OutOfMemory from Standard; ---Purpose: -- Remove the Item[Index] from the array. --- - Remove (me:out; Index:Integer from Standard) + Remove (me:out; + Index:Integer from Standard) raises OutOfMemory from Standard; ---Purpose: -- Appends the Value at the end of me --- - Value (me; Index:Integer from Standard) returns any Array1Item + Value (me; + Index:Integer from Standard) + returns any Array1Item ---C++: alias operator () ---C++: return const & raises OutOfRange from Standard; @@ -81,7 +90,9 @@ is -- array. -- - ChangeValue (me: in out; Index:Integer from Standard) returns any Array1Item + ChangeValue (me: in out; + Index:Integer from Standard) + returns any Array1Item ---C++: alias operator () ---C++: return & raises OutOfRange from Standard; @@ -89,7 +100,8 @@ is -- Returns the value of the Index-th element of the -- array. - SetBlockLength(me:out; aBL: Integer from Standard); + SetBlockLength(me:out; + aBL: Integer from Standard); ---Purpose: -- Sets the size of the allocated block --- @@ -97,16 +109,23 @@ is returns Integer from Standard; ---Purpose: -- Returns the current size of the allocated block - --- - IsInvalidIndex (me; Index:Integer from Standard) + --- + IsInvalidIndex (me; + Index:Integer from Standard) returns Boolean from Standard is private; ---Purpose: -- Checks the input value of an Index for validity in -- array. - + + --modified by NIZNHY-PKV Wed Nov 09 09:32:13 2011f + Purge(me:out); + ---Purpose: + -- Release the memory that is allocated but unused. + -- + --modified by NIZNHY-PKV Wed Nov 09 09:32:16 2011t + fields - myStart : Address; myLength : Integer; myFactLength : Integer; diff --git a/src/BOPTColStd/BOPTColStd_CArray1.gxx b/src/BOPTColStd/BOPTColStd_CArray1.gxx index 6b13fba59d..3fff5a81aa 100755 --- a/src/BOPTColStd/BOPTColStd_CArray1.gxx +++ b/src/BOPTColStd/BOPTColStd_CArray1.gxx @@ -7,9 +7,8 @@ //function : BOPTools_CArray1::BOPTools_CArray1 //purpose : //======================================================================= - BOPTColStd_CArray1::BOPTColStd_CArray1 - (const Standard_Integer aLength, - const Standard_Integer aBlockLength) +BOPTColStd_CArray1::BOPTColStd_CArray1 (const Standard_Integer aLength, + const Standard_Integer aBlockLength) : myStart(NULL), myLength(0), @@ -23,7 +22,7 @@ //function : Resize //purpose : //======================================================================= - void BOPTColStd_CArray1::Resize(const Standard_Integer aNL) +void BOPTColStd_CArray1::Resize(const Standard_Integer aNL) { Array1Item* p = NULL; if (aNL>0) { @@ -33,7 +32,7 @@ if (!p) { Standard_OutOfMemory::Raise - ("IntBOPTools_CArray1 : Allocation failed."); + ("BOPTools_CArray1 : Allocation failed."); } else { @@ -48,43 +47,44 @@ //function : Remove //purpose : //======================================================================= - void BOPTColStd_CArray1::Remove(const Standard_Integer anInd) +void BOPTColStd_CArray1::Remove(const Standard_Integer anInd) { - if (myIsAllocated) { - if (IsInvalidIndex(anInd)) { - Standard_OutOfMemory::Raise - ("IntBOPTools_CArray1 : Attempt to remove inexisting Item."); - } - - const Standard_Integer aNFL=myFactLength-1; - - Array1Item *p=NULL; - p = new Array1Item[aNFL]; - - if (!p) { - Standard_OutOfMemory::Raise - ("IntBOPTools_CArray1::Append: Allocation failed."); - } - - Standard_Integer i, j, anIndx, iLength; - - iLength=myLength; - - anIndx=anInd-1; - for (i=0, j=0; i 0) + if (aBL > 0) { myBlockLength=aBL; + } } //======================================================================= //function : Value //purpose : //======================================================================= - const Array1Item& BOPTColStd_CArray1::Value +const Array1Item& BOPTColStd_CArray1::Value (const Standard_Integer Index) const { if (IsInvalidIndex(Index)) { @@ -210,7 +212,7 @@ //function : ChangeValue //purpose : //======================================================================= - Array1Item& BOPTColStd_CArray1::ChangeValue +Array1Item& BOPTColStd_CArray1::ChangeValue (const Standard_Integer Index) { if (IsInvalidIndex(Index)) { @@ -218,3 +220,53 @@ } return ((Array1Item *)myStart)[Index-1]; } +//modified by NIZNHY-PKV Wed Nov 09 10:03:01 2011f +//======================================================================= +//function : Purge +//purpose : +//======================================================================= +void BOPTColStd_CArray1::Purge() +{ + if (!myIsAllocated) { + return; + } + // + if (myLength>0 && myLength #include +#include static Handle(Geom2d_Curve) CurveOnSurface(const TopoDS_Edge& E, @@ -74,6 +75,12 @@ static void PrintState (Draw_Interpretor& aDI, const TopAbs_State& aState); +//modified by NIZNHY-PKV Thu Nov 10 12:11:15 2011f +static + void DumpArray(const BOPTColStd_CArray1OfInteger& aC, + Draw_Interpretor& aDI); +//modified by NIZNHY-PKV Thu Nov 10 12:11:18 2011t + static Standard_Integer bhaspc (Draw_Interpretor& , Standard_Integer , const char** ); static Standard_Integer baddve (Draw_Interpretor& , Standard_Integer , const char** ); static Standard_Integer bisclosed (Draw_Interpretor& , Standard_Integer , const char** ); @@ -86,11 +93,8 @@ static Standard_Integer brefine (Draw_Interpretor& , Standard_Integer , con static Standard_Integer bclassify (Draw_Interpretor& , Standard_Integer , const char** ); static Standard_Integer b2dclassify (Draw_Interpretor& , Standard_Integer , const char** ); -//modified by NIZNHY-PKV Mon May 29 11:44:24 2006f static Standard_Integer bhole (Draw_Interpretor& , Standard_Integer , const char** ); static Standard_Integer bxhole (Draw_Interpretor& , Standard_Integer , const char** ); -//modified by NIZNHY-PKV Mon May 29 11:44:28 2006t - //======================================================================= //function : LowCommands //purpose : @@ -120,10 +124,8 @@ static Standard_Integer bxhole (Draw_Interpretor& , Standard_Integer , con __FILE__, bclassify , g); theCommands.Add("b2dclassify" , "Use >bclassify Face Point2d [Tol2D=Tol(Face)] ", __FILE__, b2dclassify , g); - //modified by NIZNHY-PKV Mon May 29 11:45:33 2006f theCommands.Add("bhole" , "Use bhole" , __FILE__, bhole , g); theCommands.Add("bxhole" , "Use bxhole" , __FILE__, bxhole , g); - //modified by NIZNHY-PKV Mon May 29 11:45:37 2006t } //======================================================================= @@ -737,7 +739,6 @@ void PrintState (Draw_Interpretor& aDI, } // -//modified by NIZNHY-PKV Mon May 29 11:40:29 2006f //======================================================================= //function : bhole //purpose : @@ -901,4 +902,3 @@ Standard_Integer bxhole (Draw_Interpretor& aDI, // return 0; } -//modified by NIZNHY-PKV Mon May 29 11:40:31 2006t diff --git a/src/QAOCC/QAOCC.cxx b/src/QAOCC/QAOCC.cxx index 2ba6acc302..5375081598 100755 --- a/src/QAOCC/QAOCC.cxx +++ b/src/QAOCC/QAOCC.cxx @@ -5256,6 +5256,56 @@ Standard_Integer OCC22736 (Draw_Interpretor& di, Standard_Integer argc, const ch return 0; } +#include +//======================================================================= +//function : DumpArray +//purpose : +//======================================================================= +void DumpArray(const BOPTColStd_CArray1OfInteger& aC, + Draw_Interpretor& aDI) +{ + Standard_Integer iLength, iFactLength, iBlockLength; + // + iLength=aC.Length(); + iFactLength=aC.FactLength(); + iBlockLength=aC.BlockLength(); + // + aDI<< "Length: " <