mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-01 10:26:12 +03:00
License statement text corrected; compiler warnings caused by Bison 2.41 disabled for MSVC; a few other compiler warnings on 54-bit Windows eliminated by appropriate type cast Wrong license statements corrected in several files. Copyright and license statements added in XSD and GLSL files. Copyright year updated in some files. Obsolete documentation files removed from DrawResources.
121 lines
4.1 KiB
C++
121 lines
4.1 KiB
C++
// 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.
|
|
|
|
#include <RWStepVisual_RWSurfaceStyleParameterLine.ixx>
|
|
#include <StepVisual_CurveStyle.hxx>
|
|
#include <Standard_Integer.hxx>
|
|
|
|
#include <StepVisual_HArray1OfDirectionCountSelect.hxx>
|
|
|
|
#include <Interface_EntityIterator.hxx>
|
|
|
|
|
|
#include <StepVisual_SurfaceStyleParameterLine.hxx>
|
|
|
|
|
|
RWStepVisual_RWSurfaceStyleParameterLine::RWStepVisual_RWSurfaceStyleParameterLine () {}
|
|
|
|
void RWStepVisual_RWSurfaceStyleParameterLine::ReadStep
|
|
(const Handle(StepData_StepReaderData)& data,
|
|
const Standard_Integer num,
|
|
Handle(Interface_Check)& ach,
|
|
const Handle(StepVisual_SurfaceStyleParameterLine)& ent) const
|
|
{
|
|
|
|
|
|
// --- Number of Parameter Control ---
|
|
|
|
if (!data->CheckNbParams(num,2,ach,"surface_style_parameter_line")) return;
|
|
|
|
// --- own field : styleOfParameterLines ---
|
|
|
|
Handle(StepVisual_CurveStyle) aStyleOfParameterLines;
|
|
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
|
|
data->ReadEntity(num, 1,"style_of_parameter_lines", ach, STANDARD_TYPE(StepVisual_CurveStyle), aStyleOfParameterLines);
|
|
|
|
// --- own field : directionCounts ---
|
|
// DirectionCount : select de UDirectionCount et VDirectionCount qui sont
|
|
// des type INTEGER;
|
|
// Par consequent, on doit trouver dans le fichier :
|
|
// ... , (U_DIRECTION_COUNT(10), V_DIRECTION_COUNT(1)) );
|
|
|
|
Standard_Integer numr, numpr;
|
|
TCollection_AsciiString UType("U_DIRECTION_COUNT");
|
|
TCollection_AsciiString VType("V_DIRECTION_COUNT");
|
|
TCollection_AsciiString TrueType;
|
|
|
|
Handle(StepVisual_HArray1OfDirectionCountSelect) aDirectionCounts;
|
|
Standard_Integer aDirectionCountsItem;
|
|
StepVisual_DirectionCountSelect aDirectionCountSelect;
|
|
|
|
Standard_Integer nsub2;
|
|
if (data->ReadSubList (num,2,"direction_counts",ach,nsub2)) {
|
|
Standard_Integer nb2 = data->NbParams(nsub2);
|
|
aDirectionCounts = new StepVisual_HArray1OfDirectionCountSelect(1, nb2);
|
|
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
|
|
// looks for true type :
|
|
//szv#4:S4163:12Mar99 `Standard_Boolean statUV =` not needed
|
|
if (data->ReadTypedParam(nsub2,i2,Standard_True,"direction_count", ach,numr,numpr,TrueType)) {
|
|
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
|
|
if (data->ReadInteger (numr,numpr,"direction_counts",ach,aDirectionCountsItem)) {
|
|
if (TrueType == UType) {
|
|
aDirectionCountSelect.SetUDirectionCount(aDirectionCountsItem);
|
|
aDirectionCounts->SetValue(i2,aDirectionCountSelect);
|
|
}
|
|
else if (TrueType == VType) {
|
|
aDirectionCountSelect.SetVDirectionCount(aDirectionCountsItem);
|
|
aDirectionCounts->SetValue(i2,aDirectionCountSelect);
|
|
}
|
|
else {
|
|
ach->AddFail("Parameter #2 (direction_counts) item has illegal TYPE");
|
|
}
|
|
}
|
|
else {
|
|
ach->AddFail("Parameter #2 (direction_counts) item is not an INTEGER");
|
|
}
|
|
}
|
|
else {
|
|
ach->AddFail("Parameter #2 (direction_counts) item is not TYPED");
|
|
}
|
|
}
|
|
}
|
|
|
|
//--- Initialisation of the read entity ---
|
|
|
|
ent->Init(aStyleOfParameterLines, aDirectionCounts);
|
|
}
|
|
|
|
|
|
void RWStepVisual_RWSurfaceStyleParameterLine::WriteStep
|
|
(StepData_StepWriter& SW,
|
|
const Handle(StepVisual_SurfaceStyleParameterLine)& ent) const
|
|
{
|
|
|
|
// --- own field : styleOfParameterLines ---
|
|
|
|
SW.Send(ent->StyleOfParameterLines());
|
|
|
|
// --- own field : directionCounts ---
|
|
// Attention : a modifier avant utilisation
|
|
|
|
SW.Send(ent->DirectionCounts());
|
|
}
|
|
|
|
|
|
void RWStepVisual_RWSurfaceStyleParameterLine::Share(const Handle(StepVisual_SurfaceStyleParameterLine)& ent, Interface_EntityIterator& iter) const
|
|
{
|
|
|
|
iter.GetOneItem(ent->StyleOfParameterLines());
|
|
}
|
|
|