mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
Implementation of global functions STANDARD_TYPE() for types not inheriting Standard_Transient or Standard_Persistent are eliminated. Global functions and class methods ShallowCopy() are removed; also removed unused classes Visual3d_PickPath and Visual3d_PickDescriptor. Global functions and class methods ShallowDump() are removed, except for classes Standard_GUID, TopLoc_Datum, and TopLoc_Location as the latter are still used in some Debug printouts.
197 lines
6.6 KiB
Plaintext
197 lines
6.6 KiB
Plaintext
// Created on: 1992-11-24
|
|
// Created by: Mireille MERCIEN
|
|
// Copyright (c) 1992-1999 Matra Datavision
|
|
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
// ----------------------------------------------------------------------
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ----------------------------------
|
|
// Clear : Clear the Current HSequence
|
|
// ----------------------------------
|
|
void TCollection_HSequence::Clear()
|
|
{
|
|
mySequence.Clear();
|
|
}
|
|
|
|
// -------------------------------------------------
|
|
// Append : Push an item at the end of the sequence
|
|
// -------------------------------------------------
|
|
void TCollection_HSequence::Append(const Item& T)
|
|
{
|
|
mySequence.Append(T);
|
|
}
|
|
|
|
// ---------------------------------------------------
|
|
// Append : Push a Sequence at the end of the sequence
|
|
// ---------------------------------------------------
|
|
void TCollection_HSequence::Append(const Handle(TCollection_HSequence)& S)
|
|
{
|
|
Standard_Integer i,l = S->Length();
|
|
for (i = 1; i <= l; i++) mySequence.Append(S->Value(i));
|
|
}
|
|
|
|
// ---------------------------------------------------------
|
|
// Prepend : Push an element at the begining of the sequence
|
|
// ---------------------------------------------------------
|
|
void TCollection_HSequence::Prepend(const Item& T)
|
|
{
|
|
mySequence.Prepend(T);
|
|
}
|
|
|
|
// ---------------------------------------------------------
|
|
// Prepend : Push an element at the begining of the sequence
|
|
// ---------------------------------------------------------
|
|
void TCollection_HSequence::Prepend(const Handle(TCollection_HSequence)& S)
|
|
{
|
|
Standard_Integer i,l = S->Length();
|
|
for (i = 0; i < l; i++) mySequence.Prepend(S->Value(S->Length()-i));
|
|
}
|
|
|
|
// ---------------------------------------------------------
|
|
// Reverse : Reverse the order of a given sequence
|
|
// ---------------------------------------------------------
|
|
void TCollection_HSequence::Reverse()
|
|
{
|
|
mySequence.Reverse();
|
|
}
|
|
|
|
// -------------------------------------------------------------------
|
|
// InsertBefore : Insert an item before a given index in the sequence
|
|
// --------------------------------------------------------------------
|
|
void TCollection_HSequence::InsertBefore(const Standard_Integer Index,
|
|
const Item& T)
|
|
{
|
|
mySequence.InsertBefore(Index,T);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// InsertBefore : Insert a sequence before a specific index in a HSequence
|
|
// ----------------------------------------------------------------------
|
|
void TCollection_HSequence::InsertBefore(const Standard_Integer Index ,
|
|
const Handle(TCollection_HSequence)& S)
|
|
{
|
|
Standard_Integer i,l = S->Length();
|
|
for (i = 1; i <= l; i++) mySequence.InsertBefore(Index+i-1,S->Value(i));
|
|
}
|
|
|
|
// -----------------------------------------------------------------
|
|
// InsertAfter : Insert an element after a given index in a sequence
|
|
// -----------------------------------------------------------------
|
|
void TCollection_HSequence::InsertAfter(const Standard_Integer Index,
|
|
const Item& T)
|
|
{
|
|
mySequence.InsertAfter(Index,T);
|
|
}
|
|
|
|
// -------------------------------------------------------------------
|
|
// InsertAfter : Insert a sequence after a given index in the sequence
|
|
// -------------------------------------------------------------------
|
|
void TCollection_HSequence::InsertAfter(const Standard_Integer Index,
|
|
const Handle(TCollection_HSequence)& S)
|
|
{
|
|
Standard_Integer i,l = S->Length();
|
|
for (i = 1; i <= l; i++) mySequence.InsertAfter(Index+i-1,S->Value(i));
|
|
}
|
|
|
|
// ----------------------------------------
|
|
// Exchange : Exchange two elements in the sequence
|
|
// ----------------------------------------
|
|
void TCollection_HSequence::Exchange(const Standard_Integer I,
|
|
const Standard_Integer J)
|
|
{
|
|
mySequence.Exchange(I,J);
|
|
}
|
|
|
|
// ---------------------------------------------
|
|
// Split : Split a sequence in two sub-sequences
|
|
// ---------------------------------------------
|
|
Handle (TCollection_HSequence)
|
|
TCollection_HSequence::Split(const Standard_Integer Index)
|
|
{
|
|
TheSequence SS;
|
|
mySequence.Split(Index,SS);
|
|
Handle(TCollection_HSequence) NS = new TCollection_HSequence();
|
|
Standard_Integer i,l = SS.Length();
|
|
for (i=1; i<= l; i++) NS->Append(SS(i));
|
|
return NS;
|
|
}
|
|
|
|
// ----------------------------------------------------------
|
|
// SetValue : Change the element of a given index in a sequence
|
|
// ----------------------------------------------------------
|
|
void TCollection_HSequence::SetValue(const Standard_Integer Index,
|
|
const Item& T)
|
|
{
|
|
mySequence(Index) = T;
|
|
}
|
|
|
|
// -----------------------------------------
|
|
// Value : Return the value of a given index
|
|
// -----------------------------------------
|
|
const Item& TCollection_HSequence::Value(const Standard_Integer Index) const
|
|
{
|
|
return (mySequence(Index));
|
|
}
|
|
|
|
// -----------------------------------------
|
|
// ChangeValue : Return the value of a given index
|
|
// -----------------------------------------
|
|
Item& TCollection_HSequence::ChangeValue(const Standard_Integer Index)
|
|
{
|
|
return (mySequence(Index));
|
|
}
|
|
|
|
// -------------------------------------
|
|
// Remove : Remove an item in a sequence
|
|
// -------------------------------------
|
|
void TCollection_HSequence::Remove(const Standard_Integer Index)
|
|
{
|
|
mySequence.Remove(Index);
|
|
}
|
|
|
|
// ---------------------
|
|
// Remove a set of items
|
|
// ---------------------
|
|
void TCollection_HSequence::Remove(const Standard_Integer From,
|
|
const Standard_Integer To)
|
|
{
|
|
mySequence.Remove(From,To);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// IsSamestate
|
|
// ----------------------------------------------------------------------------
|
|
// Standard_Boolean TCollection_HSequence::IsSameState
|
|
// (const Handle(TCollection_HSequence)& other) const
|
|
// {
|
|
// Handle(TCollection_HSequence) Seq =
|
|
// Handle(TCollection_HSequence)::DownCast(other);
|
|
// if (Seq->Length() != Length()) return Standard_False;
|
|
// for (Standard_Integer I = 1; I<= Length(); I++) {
|
|
// if ( !(Value(I) == Seq->Value(I)) ) return Standard_False;
|
|
// }
|
|
// return Standard_True;
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|