mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-12 09:59:03 +08:00
Configuration - Reorganize repository structure #450
Reorganizing structure to have Module/TK/Package/FILES structure. New structure reflect the structure inside IDE. Migrate FILES, PACKAGES, EXTRLIB to CMake version to handle changes on updates. No changes were done to installation layout, all installation result keep as before. The migration was done using python script, see PR, which refactor automatically the structure. Updated doc generation to have valid path to modules, toolkits and packages. In case of PR into new version, IR-790 can be used as a target for the previous version.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# Source files for ShapeProcessAPI package
|
||||
set(OCCT_ShapeProcessAPI_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
set(OCCT_ShapeProcessAPI_FILES
|
||||
ShapeProcessAPI_ApplySequence.cxx
|
||||
ShapeProcessAPI_ApplySequence.hxx
|
||||
)
|
||||
@@ -0,0 +1,156 @@
|
||||
// Created on: 1999-06-22
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Resource_Manager.hxx>
|
||||
#include <ShapeProcess.hxx>
|
||||
#include <ShapeProcess_OperLibrary.hxx>
|
||||
#include <ShapeProcess_ShapeContext.hxx>
|
||||
#include <ShapeProcessAPI_ApplySequence.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
ShapeProcessAPI_ApplySequence::ShapeProcessAPI_ApplySequence(const Standard_CString rscName,
|
||||
const Standard_CString seqName)
|
||||
{
|
||||
|
||||
myContext = new ShapeProcess_ShapeContext(rscName);
|
||||
myContext->SetDetalisation(TopAbs_FACE);
|
||||
TCollection_AsciiString str(seqName);
|
||||
|
||||
// initialize operators
|
||||
ShapeProcess_OperLibrary::Init();
|
||||
|
||||
mySeq = str;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Handle(ShapeProcess_ShapeContext)& ShapeProcessAPI_ApplySequence::Context()
|
||||
{
|
||||
return myContext;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
TopoDS_Shape ShapeProcessAPI_ApplySequence::PrepareShape(const TopoDS_Shape& shape,
|
||||
const Standard_Boolean /*fillmap*/,
|
||||
const TopAbs_ShapeEnum /*until*/,
|
||||
const Message_ProgressRange& theProgress)
|
||||
{
|
||||
if (shape.IsNull())
|
||||
return shape;
|
||||
Handle(Resource_Manager) rsc = myContext->ResourceManager();
|
||||
myContext->Init(shape);
|
||||
|
||||
TCollection_AsciiString str(mySeq);
|
||||
str += ".exec.op";
|
||||
if (rsc->Find(str.ToCString()))
|
||||
{
|
||||
ShapeProcess::Perform(myContext, mySeq.ToCString(), theProgress);
|
||||
}
|
||||
|
||||
return myContext->Result();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void ShapeProcessAPI_ApplySequence::ClearMap()
|
||||
{
|
||||
// myContext->Map().Clear();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
const TopTools_DataMapOfShapeShape& ShapeProcessAPI_ApplySequence::Map() const
|
||||
{
|
||||
return myContext->Map();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void ShapeProcessAPI_ApplySequence::PrintPreparationResult() const
|
||||
{
|
||||
Standard_Integer SS = 0, SN = 0, FF = 0, FS = 0, FN = 0;
|
||||
for (TopTools_DataMapIteratorOfDataMapOfShapeShape It(myContext->Map()); It.More(); It.Next())
|
||||
{
|
||||
TopoDS_Shape keyshape = It.Key(), valueshape = It.Value();
|
||||
if (keyshape.ShapeType() == TopAbs_SHELL)
|
||||
{
|
||||
if (valueshape.IsNull())
|
||||
SN++;
|
||||
else
|
||||
SS++;
|
||||
}
|
||||
else if (keyshape.ShapeType() == TopAbs_FACE)
|
||||
{
|
||||
if (valueshape.IsNull())
|
||||
FN++;
|
||||
else if (valueshape.ShapeType() == TopAbs_SHELL)
|
||||
FS++;
|
||||
else
|
||||
FF++;
|
||||
}
|
||||
}
|
||||
|
||||
Handle(Message_Messenger) aMessenger = myContext->Messenger();
|
||||
|
||||
// mapping
|
||||
Message_Msg EPMSG100("PrResult.Print.MSG100"); // Mapping:
|
||||
aMessenger->Send(EPMSG100, Message_Info);
|
||||
Message_Msg TPMSG50("PrResult.Print.MSG50"); // Shells:
|
||||
aMessenger->Send(TPMSG50, Message_Info);
|
||||
Message_Msg EPMSG110("PrResult.Print.MSG110"); // Result is Shell : %d
|
||||
EPMSG110.Arg(SS);
|
||||
aMessenger->Send(EPMSG110, Message_Info);
|
||||
Message_Msg EPMSG150("PrResult.Print.MSG150"); // No Result : %d
|
||||
EPMSG150.Arg(SN);
|
||||
aMessenger->Send(EPMSG150, Message_Info);
|
||||
|
||||
TCollection_AsciiString tmp110(EPMSG110.Original()), tmp150(EPMSG150.Original());
|
||||
EPMSG110.Set(tmp110.ToCString());
|
||||
EPMSG150.Set(tmp150.ToCString());
|
||||
|
||||
Message_Msg TPMSG55("PrResult.Print.MSG55"); // Faces:
|
||||
aMessenger->Send(TPMSG55, Message_Info);
|
||||
Message_Msg EPMSG115("PrResult.Print.MSG115"); // Result is Face : %d
|
||||
EPMSG115.Arg(FF);
|
||||
aMessenger->Send(EPMSG115, Message_Info);
|
||||
EPMSG110.Arg(FS);
|
||||
aMessenger->Send(EPMSG110, Message_Info);
|
||||
EPMSG150.Arg(FN);
|
||||
aMessenger->Send(EPMSG150, Message_Info);
|
||||
|
||||
// preparation ratio
|
||||
Standard_Real SPR = 1, FPR = 1;
|
||||
Standard_Integer STotalR = SS, FTotalR = FF + FS;
|
||||
Standard_Integer NbS = STotalR + SN, NbF = FTotalR + FN;
|
||||
if (NbS > 0)
|
||||
SPR = 1. * (NbS - SN) / NbS;
|
||||
if (NbF > 0)
|
||||
FPR = 1. * (NbF - FN) / NbF;
|
||||
Message_Msg PMSG200("PrResult.Print.MSG200"); // Preparation ratio:
|
||||
aMessenger->Send(PMSG200, Message_Info);
|
||||
Message_Msg PMSG205("PrResult.Print.MSG205"); // Shells: %d per cent
|
||||
PMSG205.Arg((Standard_Integer)(100 * SPR));
|
||||
aMessenger->Send(PMSG205, Message_Info);
|
||||
Message_Msg PMSG210("PrResult.Print.MSG210"); // Faces : %d per cent
|
||||
PMSG210.Arg((Standard_Integer)(100 * FPR));
|
||||
aMessenger->Send(PMSG210, Message_Info);
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
// Created on: 1999-06-22
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 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.
|
||||
|
||||
#ifndef _ShapeProcessAPI_ApplySequence_HeaderFile
|
||||
#define _ShapeProcessAPI_ApplySequence_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <Message_ProgressRange.hxx>
|
||||
|
||||
class ShapeProcess_ShapeContext;
|
||||
class TopoDS_Shape;
|
||||
|
||||
//! Applies one of the sequence read from resource file.
|
||||
class ShapeProcessAPI_ApplySequence
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Creates an object and loads resource file and sequence of
|
||||
//! operators given by their names.
|
||||
Standard_EXPORT ShapeProcessAPI_ApplySequence(const Standard_CString rscName,
|
||||
const Standard_CString seqName = "");
|
||||
|
||||
//! Returns object for managing resource file and sequence of
|
||||
//! operators.
|
||||
Standard_EXPORT Handle(ShapeProcess_ShapeContext)& Context();
|
||||
|
||||
//! Performs sequence of operators stored in myRsc.
|
||||
//! If <fillmap> is True adds history "shape-shape" into myMap
|
||||
//! for shape and its subshapes until level <until> (included).
|
||||
//! If <until> is TopAbs_SHAPE, all the subshapes are considered.
|
||||
Standard_EXPORT TopoDS_Shape
|
||||
PrepareShape(const TopoDS_Shape& shape,
|
||||
const Standard_Boolean fillmap = Standard_False,
|
||||
const TopAbs_ShapeEnum until = TopAbs_SHAPE,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
//! Clears myMap with accumulated history.
|
||||
Standard_EXPORT void ClearMap();
|
||||
|
||||
//! Returns myMap with accumulated history.
|
||||
Standard_EXPORT const TopTools_DataMapOfShapeShape& Map() const;
|
||||
|
||||
//! Prints result of preparation onto the messenger of the context.
|
||||
//! Note that results can be accumulated from previous preparations
|
||||
//! it method ClearMap was not called before PrepareShape.
|
||||
Standard_EXPORT void PrintPreparationResult() const;
|
||||
|
||||
protected:
|
||||
private:
|
||||
Handle(ShapeProcess_ShapeContext) myContext;
|
||||
TopTools_DataMapOfShapeShape myMap;
|
||||
TCollection_AsciiString mySeq;
|
||||
};
|
||||
|
||||
#endif // _ShapeProcessAPI_ApplySequence_HeaderFile
|
||||
Reference in New Issue
Block a user