mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-25 17:00:35 +05:00
NRI : First integration.
This commit is contained in:
parent
f4fbc5bf62
commit
84c3161ed5
233
src/GEOMClient/GEOM_Client.cxx
Normal file
233
src/GEOMClient/GEOM_Client.cxx
Normal file
@ -0,0 +1,233 @@
|
||||
using namespace std;
|
||||
// File : GEOM_Client.cxx
|
||||
// Created :
|
||||
// Author : Yves FRICAUD/Lucien PIGNOLONI
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE
|
||||
// $Header$
|
||||
|
||||
#include "GEOM_Client.hxx"
|
||||
#include <SALOMEconfig.h>
|
||||
#include "utilities.h"
|
||||
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : Load()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
static TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape )
|
||||
{
|
||||
TopoDS_Shape S;
|
||||
/* get sequence of bytes of resulting brep shape from GEOM server */
|
||||
GEOM::GEOM_Shape::TMPFile_var SeqFile = aShape->GetShapeStream();
|
||||
int sizebuf = SeqFile->length();
|
||||
char* buf;
|
||||
buf = (char*) &SeqFile[0];
|
||||
istrstream streamBrep(buf,sizebuf);
|
||||
BRep_Builder aBuilder;
|
||||
BRepTools::Read(S, streamBrep, aBuilder);
|
||||
return S;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : Create()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
GEOM_Client::GEOM_Client()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : Find()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOM_Client::Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S )
|
||||
{
|
||||
for ( Standard_Integer i = 1; i<= myIORs.Length(); i++ ) {
|
||||
if (myIORs.Value(i).IsEqual(IOR)) {
|
||||
S = myShapes.Value(i);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : Bind()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void GEOM_Client::Bind( const TCollection_AsciiString& IOR, const TopoDS_Shape& S )
|
||||
{
|
||||
myIORs.Append(IOR);
|
||||
myShapes.Append(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : RemoveShapeFromBuffer()
|
||||
// purpose : Remove shape from Client Buffer
|
||||
//=======================================================================
|
||||
void GEOM_Client::RemoveShapeFromBuffer( const TCollection_AsciiString& shapeIOR )
|
||||
{
|
||||
if( myIORs.IsEmpty() )
|
||||
return ;
|
||||
|
||||
TopoDS_Shape S ;
|
||||
Standard_Integer anIndex = Find( shapeIOR, S ) ;
|
||||
if( anIndex != 0 ) {
|
||||
myIORs.Remove(anIndex) ;
|
||||
myShapes.Remove(anIndex) ;
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ClearClientBuffer()
|
||||
// purpose : purge buffer
|
||||
//=======================================================================
|
||||
void GEOM_Client::ClearClientBuffer()
|
||||
{
|
||||
if( myIORs.IsEmpty() )
|
||||
return ;
|
||||
myIORs.Clear() ;
|
||||
myShapes.Clear() ;
|
||||
return ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : BufferLength()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
unsigned int GEOM_Client::BufferLength()
|
||||
{
|
||||
return myIORs.Length() ;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : GetShape()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape )
|
||||
{
|
||||
|
||||
TopoDS_Shape S;
|
||||
TCollection_AsciiString IOR(aShape->Name());
|
||||
Standard_Integer anIndex = Find(IOR, S);
|
||||
|
||||
BRep_Builder B;
|
||||
|
||||
if (anIndex !=0 ) {
|
||||
return S ;
|
||||
}
|
||||
|
||||
/******* in case of a MAIN GEOM::SHAPE ********/
|
||||
if (aShape->IsMainShape()) {
|
||||
S = Load(geom, aShape);
|
||||
Bind(IOR,S);
|
||||
return S;
|
||||
}
|
||||
|
||||
/******* in case of SUB GEOM::SHAPE ***********/
|
||||
// Load and Explore the Main Shape
|
||||
TopoDS_Shape MainShape = GetShape (geom, geom->GetIORFromString(aShape->MainName()));
|
||||
GEOM::GEOM_Shape::ListOfSubShapeID_var list = aShape->Index();
|
||||
|
||||
Standard_Integer j = 1;
|
||||
TopExp_Explorer exp;
|
||||
TopAbs_ShapeEnum ShapeType = TopAbs_ShapeEnum(aShape->ShapeType());
|
||||
|
||||
/* Case of only one subshape */
|
||||
if (list->length() == 1)
|
||||
{
|
||||
if (ShapeType == TopAbs_COMPOUND)
|
||||
{
|
||||
TopoDS_Iterator it;
|
||||
TopTools_ListOfShape CL;
|
||||
CL.Append( MainShape );
|
||||
TopTools_ListIteratorOfListOfShape itC;
|
||||
for (itC.Initialize( CL ); itC.More(); itC.Next())
|
||||
{
|
||||
for (it.Initialize( itC.Value() ); it.More(); it.Next())
|
||||
{
|
||||
if ( it.Value().ShapeType() == TopAbs_COMPOUND)
|
||||
{
|
||||
if (j == list[0])
|
||||
{
|
||||
S = it.Value();
|
||||
Bind(IOR, S);
|
||||
return S;
|
||||
}
|
||||
j++;
|
||||
CL.Append( it.Value() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TopTools_MapOfShape M;
|
||||
for (exp.Init(MainShape, ShapeType); exp.More(); exp.Next()) {
|
||||
if ( M.Add(exp.Current()) )
|
||||
{
|
||||
if (j == list[0])
|
||||
{
|
||||
S = exp.Current();
|
||||
Bind(IOR, S);
|
||||
return S;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Case of a compound containing two or more sub shapes (not a main shape compound !) */
|
||||
|
||||
/* Warning : the compound when representing sub shapes must be explored in a sub type */
|
||||
/* that is NOT ShapeType=aShape->ShapeType()= TopAbs_COMPOUND ! */
|
||||
/* We have to retrieve the exact sub type of shapes contained in the compound first ! */
|
||||
TopoDS_Iterator it ;
|
||||
TopAbs_ShapeEnum exactSubType ;
|
||||
S = Load( geom, aShape );
|
||||
it.Initialize( S, true, true ) ;
|
||||
it.More();
|
||||
exactSubType = it.Value().ShapeType() ;
|
||||
|
||||
TColStd_MapOfInteger MapIndex;
|
||||
Standard_Integer nbSS = list->length();
|
||||
TopoDS_Compound Comp;
|
||||
B.MakeCompound(Comp);
|
||||
|
||||
for (Standard_Integer i=1; i<=nbSS; i++)
|
||||
MapIndex.Add(list[i-1]);
|
||||
|
||||
for (exp.Init(MainShape, exactSubType), j=1; exp.More() ; exp.Next(), j++) {
|
||||
if ( MapIndex.Contains(j) ) {
|
||||
B.Add( Comp, exp.Current() );
|
||||
}
|
||||
}
|
||||
Bind(IOR, Comp);
|
||||
return Comp;
|
||||
}
|
73
src/GEOMClient/GEOM_Client.hxx
Normal file
73
src/GEOMClient/GEOM_Client.hxx
Normal file
@ -0,0 +1,73 @@
|
||||
// File : GEOM_Client.hxx
|
||||
// Created :
|
||||
// Author : Yves FRICAUD
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE
|
||||
// $Header$
|
||||
|
||||
#ifndef _GEOM_Client_HeaderFile
|
||||
#define _GEOM_Client_HeaderFile
|
||||
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(GEOM_Shape)
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
#
|
||||
#ifndef _TColStd_SequenceOfAsciiString_HeaderFile
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_SequenceOfShape_HeaderFile
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
class TCollection_AsciiString;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
//=====================================================================
|
||||
// GEOM_Client : class definition
|
||||
//=====================================================================
|
||||
class GEOM_Client {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOM_Client();
|
||||
Standard_EXPORT Standard_Integer Find( const TCollection_AsciiString& ShapeIOR, TopoDS_Shape& S ) ;
|
||||
Standard_EXPORT void Bind( const TCollection_AsciiString& ShapeIOR, const TopoDS_Shape& S ) ;
|
||||
Standard_EXPORT TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape );
|
||||
Standard_EXPORT void RemoveShapeFromBuffer( const TCollection_AsciiString& shapeIOR ) ;
|
||||
Standard_EXPORT void ClearClientBuffer() ;
|
||||
Standard_EXPORT unsigned int BufferLength() ;
|
||||
|
||||
private:
|
||||
// Fields PRIVATE
|
||||
//
|
||||
TColStd_SequenceOfAsciiString myIORs ;
|
||||
TopTools_SequenceOfShape myShapes ;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
40
src/GEOMClient/Makefile.in
Normal file
40
src/GEOMClient/Makefile.in
Normal file
@ -0,0 +1,40 @@
|
||||
# -* Makefile *-
|
||||
#
|
||||
# Author : Patrick GOLDBRONN (CEA)
|
||||
# Date : 29/06/2001
|
||||
# $Header$
|
||||
#
|
||||
|
||||
# source path
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome
|
||||
|
||||
|
||||
@COMMENCE@
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS = \
|
||||
GEOM_Client.hxx
|
||||
|
||||
# Libraries targets
|
||||
|
||||
LIB = libGeometryClient.la
|
||||
LIB_SRC = GEOM_Client.cxx
|
||||
LIB_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
|
||||
|
||||
# Executables targets
|
||||
BIN =
|
||||
BIN_SRC =
|
||||
BIN_CLIENT_IDL =
|
||||
BIN_SERVER_IDL =
|
||||
|
||||
# additionnal information to compil and link file
|
||||
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
LDFLAGS += $(OCC_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
|
||||
|
||||
|
||||
@CONCLUDE@
|
||||
|
33
src/GEOMDS/GEOMDS.cdl
Normal file
33
src/GEOMDS/GEOMDS.cdl
Normal file
@ -0,0 +1,33 @@
|
||||
-- File: GEOMDS.cdl
|
||||
-- Created: Fri Mar 16 12:16:40 2001
|
||||
-- Author: Yves FRICAUD
|
||||
-- <yfr@claquox.paris1.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2001
|
||||
|
||||
|
||||
package GEOMDS
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
TDF,
|
||||
TDocStd,
|
||||
TDataStd,
|
||||
TColStd,
|
||||
TopoDS,
|
||||
TCollection,
|
||||
TNaming
|
||||
|
||||
|
||||
is
|
||||
class Application;
|
||||
class Commands;
|
||||
class Explorer;
|
||||
|
||||
|
||||
class DataMapOfIntegerTransient instantiates DataMap from
|
||||
TCollection(Integer from Standard, Transient from Standard, MapIntegerHasher
|
||||
from TColStd);
|
||||
|
||||
end GEOMDS;
|
||||
|
31
src/GEOMDS/GEOMDS_Application.cdl
Normal file
31
src/GEOMDS/GEOMDS_Application.cdl
Normal file
@ -0,0 +1,31 @@
|
||||
// File : GEOMDS_Application.cdl
|
||||
// Created :
|
||||
// Author : Yves FRICAUD
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : OPEN CASCADE
|
||||
// $Header$
|
||||
|
||||
|
||||
class Application from GEOMDS inherits Application from TDocStd
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Label from TDF,
|
||||
SequenceOfExtendedString from TColStd,
|
||||
CString from Standard,
|
||||
Document from TDocStd
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns mutable Application from GEOMDS;
|
||||
|
||||
Formats(me: mutable; Formats: out SequenceOfExtendedString from TColStd)
|
||||
is redefined;
|
||||
|
||||
ResourcesName (me: mutable) returns CString from Standard;
|
||||
|
||||
end Application;
|
47
src/GEOMDS/GEOMDS_Application.cxx
Normal file
47
src/GEOMDS/GEOMDS_Application.cxx
Normal file
@ -0,0 +1,47 @@
|
||||
using namespace std;
|
||||
// File : GEOMDS_Application.cxx
|
||||
// Created :
|
||||
// Author : Yves FRICAUD
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : OPEN CASCADE
|
||||
// $Header$
|
||||
|
||||
|
||||
#include "GEOMDS_Application.ixx"
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMDS_Application
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GEOMDS_Application::GEOMDS_Application()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Formats
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GEOMDS_Application::Formats(TColStd_SequenceOfExtendedString& Formats)
|
||||
{
|
||||
Formats.Append(TCollection_ExtendedString ("SALOME_GEOM"));
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ResourcesName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_CString GEOMDS_Application::ResourcesName()
|
||||
{
|
||||
return Standard_CString ("Resources");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
101
src/GEOMDS/GEOMDS_Application.hxx
Normal file
101
src/GEOMDS/GEOMDS_Application.hxx
Normal file
@ -0,0 +1,101 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#ifndef _GEOMDS_Application_HeaderFile
|
||||
#define _GEOMDS_Application_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMDS_Application_HeaderFile
|
||||
#include <Handle_GEOMDS_Application.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TDocStd_Application_HeaderFile
|
||||
#include <TDocStd_Application.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_CString_HeaderFile
|
||||
#include <Standard_CString.hxx>
|
||||
#endif
|
||||
class TColStd_SequenceOfExtendedString;
|
||||
|
||||
|
||||
class GEOMDS_Application : public TDocStd_Application {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOMDS_Application();
|
||||
Standard_EXPORT virtual void Formats(TColStd_SequenceOfExtendedString& Formats) ;
|
||||
Standard_EXPORT Standard_CString ResourcesName() ;
|
||||
Standard_EXPORT ~GEOMDS_Application();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& GEOMDS_Application_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
74
src/GEOMDS/GEOMDS_Application.ixx
Normal file
74
src/GEOMDS/GEOMDS_Application.ixx
Normal file
@ -0,0 +1,74 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOMDS_Application.jxx"
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
GEOMDS_Application::~GEOMDS_Application() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOMDS_Application_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TDocStd_Application);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDocStd_Application);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(CDF_Application);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(CDF_Application);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(CDM_Application);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(CDM_Application);
|
||||
static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOMDS_Application",
|
||||
sizeof(GEOMDS_Application),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
|
||||
|
||||
const Handle(GEOMDS_Application) Handle(GEOMDS_Application)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOMDS_Application) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOMDS_Application))) {
|
||||
_anOtherObject = Handle(GEOMDS_Application)((Handle(GEOMDS_Application)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
|
||||
|
||||
const Handle(Standard_Type)& GEOMDS_Application::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOMDS_Application) ;
|
||||
}
|
||||
Standard_Boolean GEOMDS_Application::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(GEOMDS_Application) == AType || TDocStd_Application::IsKind(AType));
|
||||
}
|
||||
Handle_GEOMDS_Application::~Handle_GEOMDS_Application() {}
|
6
src/GEOMDS/GEOMDS_Application.jxx
Normal file
6
src/GEOMDS/GEOMDS_Application.jxx
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
|
||||
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMDS_Application_HeaderFile
|
||||
#include "GEOMDS_Application.hxx"
|
||||
#endif
|
26
src/GEOMDS/GEOMDS_Commands.cdl
Normal file
26
src/GEOMDS/GEOMDS_Commands.cdl
Normal file
@ -0,0 +1,26 @@
|
||||
-- File: GEOMDS_Commands.cdl
|
||||
-- Created: Fri Mar 16 12:21:51 2001
|
||||
-- Author: Yves FRICAUD
|
||||
-- <yfr@claquox.paris1.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2001
|
||||
|
||||
|
||||
class Commands from GEOMDS
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Label from TDF,
|
||||
Shape from TopoDS,
|
||||
ExtendedString from TCollection
|
||||
|
||||
is
|
||||
Create ( Main : Label from TDF) returns Commands from GEOMDS;
|
||||
|
||||
AddShape(me : in out; S : Shape from TopoDS;
|
||||
Name : ExtendedString from TCollection)
|
||||
returns Label from TDF;
|
||||
|
||||
fields
|
||||
myLab : Label from TDF;
|
||||
end Commands;
|
282
src/GEOMDS/GEOMDS_Commands.cxx
Normal file
282
src/GEOMDS/GEOMDS_Commands.cxx
Normal file
@ -0,0 +1,282 @@
|
||||
using namespace std;
|
||||
// File : GeomDS_Commands.cxx
|
||||
// Created :
|
||||
// Author : Yves FRICAUD/Lucien PIGNOLONI
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : OPEN CASCADE
|
||||
// $Header$
|
||||
|
||||
#include "utilities.h"
|
||||
#include "GEOMDS_Commands.ixx"
|
||||
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TDataStd_Integer.hxx>
|
||||
#include <TDF_Reference.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMDS_Commands
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMDS_Commands::GEOMDS_Commands(const TDF_Label& Main)
|
||||
: myLab(Main)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : Generated()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
TDF_Label GEOMDS_Commands::Generated(const TopoDS_Shape& S,
|
||||
const TCollection_ExtendedString& Name)
|
||||
{
|
||||
TDF_Label NewLab = myLab.NewChild();
|
||||
TNaming_Builder B(NewLab);
|
||||
B.Generated(S);
|
||||
TDataStd_Name::Set(NewLab,Name);
|
||||
return NewLab;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : Generated()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
TDF_Label GEOMDS_Commands::Generated(const TopoDS_Shape& S1,
|
||||
const TopoDS_Shape& S2,
|
||||
const TCollection_ExtendedString& Name)
|
||||
{
|
||||
TDF_Label NewLab = myLab.NewChild();
|
||||
TNaming_Builder B(NewLab);
|
||||
B.Generated(S1,S2);
|
||||
TDataStd_Name::Set(NewLab,Name);
|
||||
return NewLab;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : AddShape()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
TDF_Label GEOMDS_Commands::AddShape(const TopoDS_Shape& S,
|
||||
const TCollection_ExtendedString& Name)
|
||||
{
|
||||
TDF_Label NewLab = myLab.NewChild();
|
||||
TNaming_Builder B(NewLab);
|
||||
B.Select(S,S);
|
||||
TDataStd_Name::Set(NewLab,Name);
|
||||
return NewLab;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : AddIndependentShape()
|
||||
// purpose : SAME than AddShape() : will be renamed later
|
||||
//=======================================================================
|
||||
TDF_Label GEOMDS_Commands::AddIndependentShape(const TopoDS_Shape& S,
|
||||
const TCollection_AsciiString& nameIOR)
|
||||
{
|
||||
TDF_Label NewLab = myLab.NewChild();
|
||||
TNaming_Builder B(NewLab);
|
||||
B.Select(S,S);
|
||||
TDataStd_Name::Set(NewLab, nameIOR);
|
||||
return NewLab;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : AddDependentShape()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
TDF_Label GEOMDS_Commands::AddDependentShape(const TopoDS_Shape& S,
|
||||
const TCollection_AsciiString& nameIOR,
|
||||
const TDF_Label& mainLab)
|
||||
{
|
||||
TDF_Label NewLab = myLab.NewChild();
|
||||
TNaming_Builder B(NewLab);
|
||||
B.Select(S,S);
|
||||
TDataStd_Name::Set(NewLab, nameIOR);
|
||||
/* NewLab has a reference attribute to mainLab (the main shape in fact) */
|
||||
TDF_Reference::Set(NewLab, mainLab) ;
|
||||
return NewLab;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : AddConstructiveElement()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
TDF_Label GEOMDS_Commands::AddConstructiveElement(const TopoDS_Shape& S,
|
||||
const TCollection_ExtendedString& nameIOR,
|
||||
const GEOMDS_ConstructiveType& aType)
|
||||
{
|
||||
TDF_Label NewLab = myLab.NewChild();
|
||||
TNaming_Builder B(NewLab);
|
||||
B.Select(S,S);
|
||||
TDataStd_Name::Set(NewLab, nameIOR);
|
||||
/* Add the Attribute Constructive Element coded with a TDataStd_Integer from an enum */
|
||||
TDataStd_Integer::Set(NewLab, Standard_Integer(aType));
|
||||
return NewLab;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : AddIORNameAttribute()
|
||||
// purpose : Add attribute TDataStd_Name to a label
|
||||
// : this attribute represents the name/IOR of object
|
||||
// : Return false if attribute exist before
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::AddIORNameAttribute(const TDF_Label& aLabel,
|
||||
const TCollection_ExtendedString& nameIOR)
|
||||
{
|
||||
if( this->HasIOR(aLabel) )
|
||||
return false ;
|
||||
TDataStd_Name::Set(aLabel, nameIOR);
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : IsConstructiveElement() 1/2
|
||||
// purpose : Return true if 'aLabel' is a constructive element
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::IsConstructiveElement(const TDF_Label& aLabel)
|
||||
{
|
||||
Handle(TDataStd_Integer) anAttType ;
|
||||
if( aLabel.FindAttribute(TDataStd_Integer::GetID(), anAttType ) )
|
||||
return true ;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : IsConstructiveElement() 2/2
|
||||
// purpose : Return true if 'aLabel' is a constructive element and return the
|
||||
// : topology ' returnTopo' and type 'returnType'
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::IsConstructiveElement(const TDF_Label& aLabel,
|
||||
TopoDS_Shape& returnTopo,
|
||||
GEOMDS_ConstructiveType& returnType)
|
||||
{
|
||||
Handle(TDataStd_Integer) anAttType ;
|
||||
Handle(TNaming_NamedShape) anAttTopo ;
|
||||
|
||||
if( aLabel.FindAttribute(TDataStd_Integer::GetID(), anAttType) && aLabel.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo)) {
|
||||
|
||||
returnTopo = TNaming_Tool::GetShape(anAttTopo) ;
|
||||
returnType = GEOMDS_ConstructiveType( anAttType->Get() ) ;
|
||||
return true ;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : GetShape()
|
||||
// purpose : return true and 'returnTopo' if a topology is found on 'aLabel'
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::GetShape(const TDF_Label& aLabel,
|
||||
TopoDS_Shape& returnTopo)
|
||||
{
|
||||
Handle(TNaming_NamedShape) anAttTopo ;
|
||||
if( aLabel.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo)) {
|
||||
returnTopo = TNaming_Tool::GetShape(anAttTopo) ;
|
||||
return true ;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : IsDependentShape()
|
||||
// purpose : return true if the shape in the label is dependant (a sub shape)
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::IsDependentShape(const TDF_Label& aLabel)
|
||||
{
|
||||
Handle(TDF_Reference) anAttRef ;
|
||||
if( aLabel.FindAttribute(TDF_Reference::GetID(), anAttRef))
|
||||
return true ;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : GetMainShapeLabel()
|
||||
// purpose : return true if an attribute Reference is found for 'aLabel'
|
||||
// : so 'returnMainLabel' is defined. 'aLabel' is supposed to be
|
||||
// : a dependent object, otherwise return false.
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::GetMainShapeLabel(const TDF_Label& aLabel,
|
||||
TDF_Label& returnMainLabel)
|
||||
{
|
||||
Handle(TDF_Reference) anAttRef ;
|
||||
if( aLabel.FindAttribute(TDF_Reference::GetID(), anAttRef)) {
|
||||
returnMainLabel = anAttRef->Get() ;
|
||||
return true ;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ClearAllIOR()
|
||||
// purpose : Clear all IOR from aLabel usually the main label.
|
||||
// : Useful before reconstruction after a load of a document.
|
||||
// : IOR is the attribute often called 'name' or 'nameIOR'
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::ClearAllIOR(const TDF_Label& aLabel)
|
||||
{
|
||||
TDF_ChildIterator it;
|
||||
Handle(TDataStd_Name) anAttName ;
|
||||
bool notTested = false ;
|
||||
for( it.Initialize(aLabel, Standard_False); it.More(); it.Next() ) {
|
||||
TDF_Label L = it.Value() ;
|
||||
if( L.FindAttribute(TDataStd_Name::GetID(), anAttName) ) {
|
||||
notTested = L.ForgetAttribute(TDataStd_Name::GetID()) ;
|
||||
}
|
||||
if(notTested)
|
||||
MESSAGE("in GEOMDS_Commands::ClearAllIOR : IOR CLEARED" )
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : HasIOR()
|
||||
// purpose : Return true is 'aLabel' has an attribute IOR (nameIOR)
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::HasIOR(const TDF_Label& aLabel)
|
||||
{
|
||||
Handle(TDataStd_Name) anAttName ;
|
||||
if( !aLabel.FindAttribute(TDataStd_Name::GetID(), anAttName) )
|
||||
return false ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : ReturnNameIOR()
|
||||
// purpose : Return true is 'aLabel' has an attribute IOR (nameIOR)
|
||||
// : and define 'returnNameIOR'
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMDS_Commands::ReturnNameIOR(const TDF_Label& aLabel,
|
||||
TCollection_ExtendedString& returnNameIOR)
|
||||
{
|
||||
Handle(TDataStd_Name) anAttName ;
|
||||
if( !aLabel.FindAttribute(TDataStd_Name::GetID(), anAttName) )
|
||||
return false ;
|
||||
else {
|
||||
returnNameIOR = anAttName->Get() ;
|
||||
return true ;
|
||||
}
|
||||
}
|
131
src/GEOMDS/GEOMDS_Commands.hxx
Normal file
131
src/GEOMDS/GEOMDS_Commands.hxx
Normal file
@ -0,0 +1,131 @@
|
||||
// File : GeomDS_Commands.hxx
|
||||
// Created :
|
||||
// Author : Yves FRICAUD/Lucien PIGNOLONI
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : OPEN CASCADE
|
||||
// $Header$
|
||||
|
||||
|
||||
#ifndef _GEOMDS_Commands_HeaderFile
|
||||
#define _GEOMDS_Commands_HeaderFile
|
||||
|
||||
#ifndef _TDF_Label_HeaderFile
|
||||
#include <TDF_Label.hxx>
|
||||
#endif
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
class TCollection_ExtendedString;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//============================================================================
|
||||
// class : GEOMDS_Commands
|
||||
// purpose :
|
||||
//============================================================================
|
||||
class GEOMDS_Commands {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
|
||||
// used for specific entities
|
||||
enum GEOMDS_ConstructiveType { VECTOR, LINE, PLANE } ;
|
||||
|
||||
// Methods to add or create items in the data structure
|
||||
Standard_EXPORT GEOMDS_Commands(const TDF_Label& Main);
|
||||
Standard_EXPORT TDF_Label AddShape(const TopoDS_Shape& S,
|
||||
const TCollection_ExtendedString& Name) ;
|
||||
|
||||
Standard_EXPORT TDF_Label Generated(const TopoDS_Shape& S,
|
||||
const TCollection_ExtendedString& Name) ;
|
||||
Standard_EXPORT TDF_Label Generated(const TopoDS_Shape& S1,
|
||||
const TopoDS_Shape& S2,
|
||||
const TCollection_ExtendedString& Name) ;
|
||||
|
||||
/* Shapes construction */
|
||||
Standard_EXPORT TDF_Label AddIndependentShape(const TopoDS_Shape& S,
|
||||
const TCollection_AsciiString& nameIOR) ;
|
||||
Standard_EXPORT TDF_Label AddDependentShape(const TopoDS_Shape& S,
|
||||
const TCollection_AsciiString& nameIOR,
|
||||
const TDF_Label& mainLab) ;
|
||||
Standard_EXPORT TDF_Label AddConstructiveElement(const TopoDS_Shape& S,
|
||||
const TCollection_ExtendedString& nameIOR,
|
||||
const GEOMDS_ConstructiveType& aType);
|
||||
|
||||
Standard_EXPORT Standard_Boolean AddIORNameAttribute(const TDF_Label& aLabel,
|
||||
const TCollection_ExtendedString& nameIOR) ;
|
||||
|
||||
/* Shapes query */
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel,
|
||||
TopoDS_Shape& returnTopo,
|
||||
GEOMDS_ConstructiveType& returnType) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean GetShape(const TDF_Label& aLabel,
|
||||
TopoDS_Shape& returnTopo) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDependentShape(const TDF_Label& aLabel) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean GetMainShapeLabel(const TDF_Label& aLabel,
|
||||
TDF_Label& returnMainLabel) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean ClearAllIOR(const TDF_Label& aLabel) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasIOR(const TDF_Label& aLabel) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean ReturnNameIOR(const TDF_Label& aLabel,
|
||||
TCollection_ExtendedString& returnNameIOR) ;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
TDF_Label myLab;
|
||||
|
||||
};
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
19
src/GEOMDS/GEOMDS_Commands.ixx
Normal file
19
src/GEOMDS/GEOMDS_Commands.ixx
Normal file
@ -0,0 +1,19 @@
|
||||
// File generated by CPPExt (Value)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOMDS_Commands.jxx"
|
||||
|
||||
|
||||
|
||||
|
12
src/GEOMDS/GEOMDS_Commands.jxx
Normal file
12
src/GEOMDS/GEOMDS_Commands.jxx
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef _TDF_Label_HeaderFile
|
||||
#include <TDF_Label.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_ExtendedString_HeaderFile
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMDS_Commands_HeaderFile
|
||||
#include "GEOMDS_Commands.hxx"
|
||||
#endif
|
106
src/GEOMDS/GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx
Normal file
106
src/GEOMDS/GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx
Normal file
@ -0,0 +1,106 @@
|
||||
// File generated by CPPExt (Value)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient_HeaderFile
|
||||
#define _GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient_HeaderFile
|
||||
|
||||
#ifndef _TCollection_BasicMapIterator_HeaderFile
|
||||
#include <TCollection_BasicMapIterator.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Standard_Transient_HeaderFile
|
||||
#include <Handle_Standard_Transient.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
#include "Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_Transient;
|
||||
class TColStd_MapIntegerHasher;
|
||||
class GEOMDS_DataMapOfIntegerTransient;
|
||||
class GEOMDS_DataMapNodeOfDataMapOfIntegerTransient;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
class GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient : public TCollection_BasicMapIterator {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient();
|
||||
Standard_EXPORT GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient(const GEOMDS_DataMapOfIntegerTransient& aMap);
|
||||
Standard_EXPORT void Initialize(const GEOMDS_DataMapOfIntegerTransient& aMap) ;
|
||||
Standard_EXPORT const Standard_Integer& Key() const;
|
||||
Standard_EXPORT const Handle_Standard_Transient& Value() const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,50 @@
|
||||
using namespace std;
|
||||
// File generated by CPPExt (Value)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx"
|
||||
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Transient_HeaderFile
|
||||
#include <Standard_Transient.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_MapIntegerHasher_HeaderFile
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMDS_DataMapOfIntegerTransient_HeaderFile
|
||||
#include "GEOMDS_DataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
#ifndef _GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
#include "GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey Standard_Integer
|
||||
#define TheKey_hxx <Standard_Integer.hxx>
|
||||
#define TheItem Handle_Standard_Transient
|
||||
#define TheItem_hxx <Standard_Transient.hxx>
|
||||
#define Hasher TColStd_MapIntegerHasher
|
||||
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_hxx <GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx>
|
||||
#define TCollection_DataMapIterator GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapIterator_hxx <GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_Type_() GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_Type_()
|
||||
#define TCollection_DataMap GEOMDS_DataMapOfIntegerTransient
|
||||
#define TCollection_DataMap_hxx <GEOMDS_DataMapOfIntegerTransient.hxx>
|
||||
#include <TCollection_DataMapIterator.gxx>
|
||||
|
141
src/GEOMDS/GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx
Normal file
141
src/GEOMDS/GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx
Normal file
@ -0,0 +1,141 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#ifndef _GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
#define _GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
#include "Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Standard_Transient_HeaderFile
|
||||
#include <Handle_Standard_Transient.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNode_HeaderFile
|
||||
#include <TCollection_MapNode.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||
#include <TCollection_MapNodePtr.hxx>
|
||||
#endif
|
||||
class Standard_Transient;
|
||||
class TColStd_MapIntegerHasher;
|
||||
class GEOMDS_DataMapOfIntegerTransient;
|
||||
class GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient;
|
||||
|
||||
|
||||
class GEOMDS_DataMapNodeOfDataMapOfIntegerTransient : public TCollection_MapNode {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT inline GEOMDS_DataMapNodeOfDataMapOfIntegerTransient(const Standard_Integer& K,const Handle(Standard_Transient)& I,const TCollection_MapNodePtr& n);
|
||||
Standard_EXPORT inline Standard_Integer& Key() const;
|
||||
Standard_EXPORT inline Handle_Standard_Transient& Value() const;
|
||||
Standard_EXPORT ~GEOMDS_DataMapNodeOfDataMapOfIntegerTransient();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Integer myKey;
|
||||
Handle_Standard_Transient myValue;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheKey Standard_Integer
|
||||
#define TheKey_hxx <Standard_Integer.hxx>
|
||||
#define TheItem Handle_Standard_Transient
|
||||
#define TheItem_hxx <Standard_Transient.hxx>
|
||||
#define Hasher TColStd_MapIntegerHasher
|
||||
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_hxx <GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx>
|
||||
#define TCollection_DataMapIterator GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapIterator_hxx <GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_Type_() GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_Type_()
|
||||
#define TCollection_DataMap GEOMDS_DataMapOfIntegerTransient
|
||||
#define TCollection_DataMap_hxx <GEOMDS_DataMapOfIntegerTransient.hxx>
|
||||
|
||||
#include <TCollection_DataMapNode.lxx>
|
||||
|
||||
#undef TheKey
|
||||
#undef TheKey_hxx
|
||||
#undef TheItem
|
||||
#undef TheItem_hxx
|
||||
#undef Hasher
|
||||
#undef Hasher_hxx
|
||||
#undef TCollection_DataMapNode
|
||||
#undef TCollection_DataMapNode_hxx
|
||||
#undef TCollection_DataMapIterator
|
||||
#undef TCollection_DataMapIterator_hxx
|
||||
#undef Handle_TCollection_DataMapNode
|
||||
#undef TCollection_DataMapNode_Type_
|
||||
#undef TCollection_DataMap
|
||||
#undef TCollection_DataMap_hxx
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,99 @@
|
||||
using namespace std;
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx"
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Standard_Transient_HeaderFile
|
||||
#include <Standard_Transient.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_MapIntegerHasher_HeaderFile
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMDS_DataMapOfIntegerTransient_HeaderFile
|
||||
#include "GEOMDS_DataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
#ifndef _GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient_HeaderFile
|
||||
#include "GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
GEOMDS_DataMapNodeOfDataMapOfIntegerTransient::~GEOMDS_DataMapNodeOfDataMapOfIntegerTransient() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TCollection_MapNode);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOMDS_DataMapNodeOfDataMapOfIntegerTransient",
|
||||
sizeof(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient) Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient))) {
|
||||
_anOtherObject = Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)((Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOMDS_DataMapNodeOfDataMapOfIntegerTransient::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient) ;
|
||||
}
|
||||
Standard_Boolean GEOMDS_DataMapNodeOfDataMapOfIntegerTransient::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient) == AType || TCollection_MapNode::IsKind(AType));
|
||||
}
|
||||
Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient::~Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient() {}
|
||||
#define TheKey Standard_Integer
|
||||
#define TheKey_hxx <Standard_Integer.hxx>
|
||||
#define TheItem Handle_Standard_Transient
|
||||
#define TheItem_hxx <Standard_Transient.hxx>
|
||||
#define Hasher TColStd_MapIntegerHasher
|
||||
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_hxx <GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx>
|
||||
#define TCollection_DataMapIterator GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapIterator_hxx <GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_Type_() GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_Type_()
|
||||
#define TCollection_DataMap GEOMDS_DataMapOfIntegerTransient
|
||||
#define TCollection_DataMap_hxx <GEOMDS_DataMapOfIntegerTransient.hxx>
|
||||
#include <TCollection_DataMapNode.gxx>
|
||||
|
128
src/GEOMDS/GEOMDS_DataMapOfIntegerTransient.hxx
Normal file
128
src/GEOMDS/GEOMDS_DataMapOfIntegerTransient.hxx
Normal file
@ -0,0 +1,128 @@
|
||||
// File generated by CPPExt (Value)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _GEOMDS_DataMapOfIntegerTransient_HeaderFile
|
||||
#define _GEOMDS_DataMapOfIntegerTransient_HeaderFile
|
||||
|
||||
#ifndef _TCollection_BasicMap_HeaderFile
|
||||
#include <TCollection_BasicMap.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Standard_Transient_HeaderFile
|
||||
#include <Handle_Standard_Transient.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
#include "Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
class Standard_DomainError;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_Transient;
|
||||
class TColStd_MapIntegerHasher;
|
||||
class GEOMDS_DataMapNodeOfDataMapOfIntegerTransient;
|
||||
class GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
class GEOMDS_DataMapOfIntegerTransient : public TCollection_BasicMap {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOMDS_DataMapOfIntegerTransient(const Standard_Integer NbBuckets = 1);
|
||||
Standard_EXPORT GEOMDS_DataMapOfIntegerTransient& Assign(const GEOMDS_DataMapOfIntegerTransient& Other) ;
|
||||
GEOMDS_DataMapOfIntegerTransient& operator =(const GEOMDS_DataMapOfIntegerTransient& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||
Standard_EXPORT void Clear() ;
|
||||
~GEOMDS_DataMapOfIntegerTransient()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(Standard_Transient)& I) ;
|
||||
Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const;
|
||||
Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ;
|
||||
Standard_EXPORT const Handle_Standard_Transient& Find(const Standard_Integer& K) const;
|
||||
const Handle_Standard_Transient& operator()(const Standard_Integer& K) const
|
||||
{
|
||||
return Find(K);
|
||||
}
|
||||
|
||||
Standard_EXPORT Handle_Standard_Transient& ChangeFind(const Standard_Integer& K) ;
|
||||
Handle_Standard_Transient& operator()(const Standard_Integer& K)
|
||||
{
|
||||
return ChangeFind(K);
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
Standard_EXPORT GEOMDS_DataMapOfIntegerTransient(const GEOMDS_DataMapOfIntegerTransient& Other);
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
53
src/GEOMDS/GEOMDS_DataMapOfIntegerTransient_0.cxx
Normal file
53
src/GEOMDS/GEOMDS_DataMapOfIntegerTransient_0.cxx
Normal file
@ -0,0 +1,53 @@
|
||||
using namespace std;
|
||||
// File generated by CPPExt (Value)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOMDS_DataMapOfIntegerTransient.hxx"
|
||||
|
||||
#ifndef _Standard_DomainError_HeaderFile
|
||||
#include <Standard_DomainError.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Transient_HeaderFile
|
||||
#include <Standard_Transient.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_MapIntegerHasher_HeaderFile
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
#include "GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
#ifndef _GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient_HeaderFile
|
||||
#include "GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx"
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey Standard_Integer
|
||||
#define TheKey_hxx <Standard_Integer.hxx>
|
||||
#define TheItem Handle_Standard_Transient
|
||||
#define TheItem_hxx <Standard_Transient.hxx>
|
||||
#define Hasher TColStd_MapIntegerHasher
|
||||
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_hxx <GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx>
|
||||
#define TCollection_DataMapIterator GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapIterator_hxx <GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient
|
||||
#define TCollection_DataMapNode_Type_() GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_Type_()
|
||||
#define TCollection_DataMap GEOMDS_DataMapOfIntegerTransient
|
||||
#define TCollection_DataMap_hxx <GEOMDS_DataMapOfIntegerTransient.hxx>
|
||||
#include <TCollection_DataMap.gxx>
|
||||
|
33
src/GEOMDS/GEOMDS_Explorer.cdl
Normal file
33
src/GEOMDS/GEOMDS_Explorer.cdl
Normal file
@ -0,0 +1,33 @@
|
||||
// File : GEOMDS_Explorer.cdl
|
||||
// Created :
|
||||
// Author : Yves FRICAUD
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : OPEN CASCADE
|
||||
// $Header$
|
||||
|
||||
class Explorer from GEOMDS
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
ChildIterator from TDF,
|
||||
Label from TDF,
|
||||
ExtendedString from TCollection,
|
||||
Shape from TopoDS
|
||||
|
||||
|
||||
is
|
||||
Create ( Main : Label from TDF) returns Explorer from GEOMDS;
|
||||
|
||||
More(me : in out) returns Boolean from Standard;
|
||||
|
||||
Next(me : in out);
|
||||
|
||||
Shape(me)returns Shape from TopoDS;
|
||||
|
||||
Name(me) returns ExtendedString from TCollection;
|
||||
|
||||
fields
|
||||
myChildIterator : ChildIterator from TDF;
|
||||
end Explorer;
|
107
src/GEOMDS/GEOMDS_Explorer.cxx
Normal file
107
src/GEOMDS/GEOMDS_Explorer.cxx
Normal file
@ -0,0 +1,107 @@
|
||||
using namespace std;
|
||||
// File : GEOMDS_Explorer.cxx
|
||||
// Created :
|
||||
// Author : Yves FRICAUD
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : OPEN CASCADE
|
||||
// $Header$
|
||||
|
||||
|
||||
#include "GEOMDS_Explorer.ixx"
|
||||
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMDS_Explorer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GEOMDS_Explorer::GEOMDS_Explorer(const TDF_Label& Main) : myChildIterator(Main)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : const;
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GEOMDS_Explorer::More()
|
||||
{
|
||||
if (!myChildIterator.More())
|
||||
return 0;
|
||||
Handle(TDataStd_Name) Att;
|
||||
Handle(TNaming_NamedShape) NS;
|
||||
TDF_Label L = myChildIterator.Value();
|
||||
if (( L.FindAttribute(TDataStd_Name::GetID(),Att) ) ||
|
||||
(L.FindAttribute(TNaming_NamedShape::GetID(),NS))
|
||||
)
|
||||
return 1;
|
||||
// myChildIterator.Next();
|
||||
// More();
|
||||
return 0;
|
||||
/*
|
||||
if (!myChildIterator.More())
|
||||
return 0;
|
||||
TDF_Label L = myChildIterator.Value();
|
||||
Handle(TNaming_NamedShape) NS;
|
||||
for (TDF_ChildIterator it2(L); it2.More(); it2.Next()) {
|
||||
TDF_Label L2 = it2.Value();
|
||||
if (L2.FindAttribute(TNaming_NamedShape::GetID(),NS)) {
|
||||
return 1;
|
||||
}
|
||||
myChildIterator.Next();
|
||||
}
|
||||
return 0;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Next
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GEOMDS_Explorer::Next()
|
||||
{
|
||||
myChildIterator.Next();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Shape GEOMDS_Explorer::Shape() const
|
||||
{
|
||||
Handle(TNaming_NamedShape) NS;
|
||||
TDF_Label L = myChildIterator.Value();
|
||||
L.FindAttribute(TNaming_NamedShape::GetID(),NS);
|
||||
TopoDS_Shape S = TNaming_Tool::GetShape(NS);
|
||||
return S;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Name
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TCollection_ExtendedString GEOMDS_Explorer::Name() const
|
||||
{
|
||||
TDF_Label L = myChildIterator.Value();
|
||||
Handle(TDataStd_Name) Att;
|
||||
if ( L.FindAttribute(TDataStd_Name::GetID(),Att) )
|
||||
//L.FindAttribute(TDataStd_Name::GetID(),Att);
|
||||
return Att->Get();
|
||||
else
|
||||
return TCollection_ExtendedString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
89
src/GEOMDS/GEOMDS_Explorer.hxx
Normal file
89
src/GEOMDS/GEOMDS_Explorer.hxx
Normal file
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Value)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _GEOMDS_Explorer_HeaderFile
|
||||
#define _GEOMDS_Explorer_HeaderFile
|
||||
|
||||
#ifndef _TDF_ChildIterator_HeaderFile
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
class TCollection_ExtendedString;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
class GEOMDS_Explorer {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOMDS_Explorer(const TDF_Label& Main);
|
||||
Standard_EXPORT Standard_Boolean More() ;
|
||||
Standard_EXPORT void Next() ;
|
||||
Standard_EXPORT TopoDS_Shape Shape() const;
|
||||
Standard_EXPORT TCollection_ExtendedString Name() const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
TDF_ChildIterator myChildIterator;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
#endif
|
19
src/GEOMDS/GEOMDS_Explorer.ixx
Normal file
19
src/GEOMDS/GEOMDS_Explorer.ixx
Normal file
@ -0,0 +1,19 @@
|
||||
// File generated by CPPExt (Value)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOMDS_Explorer.jxx"
|
||||
|
||||
|
||||
|
||||
|
12
src/GEOMDS/GEOMDS_Explorer.jxx
Normal file
12
src/GEOMDS/GEOMDS_Explorer.jxx
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef _TDF_Label_HeaderFile
|
||||
#include <TDF_Label.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_ExtendedString_HeaderFile
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMDS_Explorer_HeaderFile
|
||||
#include "GEOMDS_Explorer.hxx"
|
||||
#endif
|
89
src/GEOMDS/Handle_GEOMDS_Application.hxx
Normal file
89
src/GEOMDS/Handle_GEOMDS_Application.hxx
Normal file
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _Handle_GEOMDS_Application_HeaderFile
|
||||
#define _Handle_GEOMDS_Application_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_TDocStd_Application_HeaderFile
|
||||
#include <Handle_TDocStd_Application.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(TDocStd_Application);
|
||||
class GEOMDS_Application;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SimpleOCAF_Application);
|
||||
|
||||
class Handle(GEOMDS_Application) : public Handle(TDocStd_Application) {
|
||||
public:
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
Handle(GEOMDS_Application)():Handle(TDocStd_Application)() {}
|
||||
Handle(GEOMDS_Application)(const Handle(GEOMDS_Application)& aHandle) : Handle(TDocStd_Application)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOMDS_Application)(const GEOMDS_Application* anItem) : Handle(TDocStd_Application)((TDocStd_Application *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOMDS_Application)& operator=(const Handle(GEOMDS_Application)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(GEOMDS_Application)& operator=(const GEOMDS_Application* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEOMDS_Application* operator->()
|
||||
{
|
||||
return (GEOMDS_Application *)ControlAccess();
|
||||
}
|
||||
|
||||
GEOMDS_Application* operator->() const
|
||||
{
|
||||
return (GEOMDS_Application *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(GEOMDS_Application)();
|
||||
|
||||
Standard_EXPORT static const Handle(GEOMDS_Application) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
#define _Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_TCollection_MapNode_HeaderFile
|
||||
#include <Handle_TCollection_MapNode.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(TCollection_MapNode);
|
||||
class GEOMDS_DataMapNodeOfDataMapOfIntegerTransient;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient);
|
||||
|
||||
class Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient) : public Handle(TCollection_MapNode) {
|
||||
public:
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)():Handle(TCollection_MapNode)() {}
|
||||
Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)(const Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)& aHandle) : Handle(TCollection_MapNode)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)(const GEOMDS_DataMapNodeOfDataMapOfIntegerTransient* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)& operator=(const Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)& operator=(const GEOMDS_DataMapNodeOfDataMapOfIntegerTransient* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEOMDS_DataMapNodeOfDataMapOfIntegerTransient* operator->()
|
||||
{
|
||||
return (GEOMDS_DataMapNodeOfDataMapOfIntegerTransient *)ControlAccess();
|
||||
}
|
||||
|
||||
GEOMDS_DataMapNodeOfDataMapOfIntegerTransient* operator->() const
|
||||
{
|
||||
return (GEOMDS_DataMapNodeOfDataMapOfIntegerTransient *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient)();
|
||||
|
||||
Standard_EXPORT static const Handle(GEOMDS_DataMapNodeOfDataMapOfIntegerTransient) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
54
src/GEOMDS/Makefile.in
Normal file
54
src/GEOMDS/Makefile.in
Normal file
@ -0,0 +1,54 @@
|
||||
# -* Makefile *-
|
||||
#
|
||||
# Author : Patrick GOLDBRONN (CEA)
|
||||
# Date : 29/06/2001
|
||||
# $Header$
|
||||
#
|
||||
|
||||
# source path
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
VPATH=.:$(srcdir):$(top_srcdir)/idl:$(top_builddir)/idl
|
||||
|
||||
|
||||
@COMMENCE@
|
||||
|
||||
# Libraries targets
|
||||
|
||||
LIB = libGeometryDS.la
|
||||
LIB_SRC = GEOMDS_Application.cxx \
|
||||
GEOMDS_Commands.cxx \
|
||||
GEOMDS_Explorer.cxx \
|
||||
GEOMDS_DataMapIteratorOfDataMapOfIntegerTransient_0.cxx \
|
||||
GEOMDS_DataMapNodeOfDataMapOfIntegerTransient_0.cxx \
|
||||
GEOMDS_DataMapOfIntegerTransient_0.cxx
|
||||
LIB_CLIENT_IDL =
|
||||
LIB_SERVER_IDL =
|
||||
|
||||
# Executables targets
|
||||
BIN =
|
||||
BIN_SRC =
|
||||
BIN_CLIENT_IDL =
|
||||
BIN_SERVER_IDL =
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS= GEOMDS_Application.hxx \
|
||||
GEOMDS_DataMapOfIntegerTransient.hxx \
|
||||
Handle_GEOMDS_DataMapNodeOfDataMapOfIntegerTransient.hxx \
|
||||
Handle_GEOMDS_Application.hxx \
|
||||
GEOMDS_Commands.hxx \
|
||||
GEOMDS_Explorer.hxx
|
||||
|
||||
# additionnal information to compil and link file
|
||||
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
LDFLAGS += $(OCC_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
|
||||
|
||||
# additional file to be cleaned
|
||||
MOSTLYCLEAN =
|
||||
CLEAN =
|
||||
DISTCLEAN =
|
||||
|
||||
@CONCLUDE@
|
||||
|
114
src/GEOMFiltersSelection/GEOM_EdgeFilter.cxx
Normal file
114
src/GEOMFiltersSelection/GEOM_EdgeFilter.cxx
Normal file
@ -0,0 +1,114 @@
|
||||
using namespace std;
|
||||
// File : GEOM_EdgeFilter.cxx
|
||||
// Created : Fri Dec 07 09:57:24 2001
|
||||
// Author : Nicolas REJNERI
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE
|
||||
// $Header$
|
||||
|
||||
#include "GEOM_EdgeFilter.ixx"
|
||||
#include "GEOM_Client.hxx"
|
||||
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#include "GEOM_InteractiveObject.hxx"
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
#include "SALOME_TypeFilter.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
#include "QAD_Application.h"
|
||||
#include "QAD_Desktop.h"
|
||||
#include "QAD_Study.h"
|
||||
|
||||
// Open CASCADE Includes
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
|
||||
|
||||
static GEOM_Client ShapeReader;
|
||||
|
||||
|
||||
/*!
|
||||
enumeration TypeOfEdge is AnyEdge,Line,Circle;
|
||||
*/
|
||||
GEOM_EdgeFilter::GEOM_EdgeFilter(const StdSelect_TypeOfEdge Edge,
|
||||
GEOM::GEOM_Gen_ptr geom)
|
||||
{
|
||||
myKind = Edge;
|
||||
myComponentGeom = GEOM::GEOM_Gen::_narrow(geom);
|
||||
}
|
||||
|
||||
Standard_Boolean GEOM_EdgeFilter::IsOk(const Handle(SALOME_InteractiveObject)& anObj) const
|
||||
{
|
||||
Handle(SALOME_TypeFilter) GeomFilter = new SALOME_TypeFilter( "GEOM" );
|
||||
if ( !GeomFilter->IsOk(anObj) )
|
||||
return false;
|
||||
|
||||
Handle(GEOM_ShapeTypeFilter) GeomShapeTypeFilter = new GEOM_ShapeTypeFilter( TopAbs_EDGE, myComponentGeom );
|
||||
if ( !GeomShapeTypeFilter->IsOk(anObj) )
|
||||
return false;
|
||||
|
||||
if ( anObj->hasEntry() ) {
|
||||
QAD_Study* ActiveStudy = QAD_Application::getDesktop()->getActiveStudy();
|
||||
SALOMEDS::Study_var aStudy = ActiveStudy->getStudyDocument();
|
||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( anObj->getEntry() );
|
||||
SALOMEDS::GenericAttribute_var anAttr;
|
||||
SALOMEDS::AttributeIOR_var anIOR;
|
||||
if ( !obj->_is_nil() ) {
|
||||
if (obj->FindAttribute(anAttr, "AttributeIOR")) {
|
||||
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||
GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( anIOR->Value() );
|
||||
if ( aShape->_is_nil() )
|
||||
return false;
|
||||
|
||||
TopoDS_Shape Shape = ShapeReader.GetShape( myComponentGeom, aShape );
|
||||
if ( Shape.IsNull() )
|
||||
return false;
|
||||
|
||||
switch (myKind) {
|
||||
case StdSelect_AnyEdge:
|
||||
return Standard_True;
|
||||
case StdSelect_Line:
|
||||
{
|
||||
BRepAdaptor_Curve curv(TopoDS::Edge(Shape));
|
||||
return (curv.GetType() == GeomAbs_Line);
|
||||
}
|
||||
break;
|
||||
case StdSelect_Circle:
|
||||
BRepAdaptor_Curve curv(TopoDS::Edge(Shape));
|
||||
return (curv.GetType() == GeomAbs_Circle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( anObj->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) {
|
||||
Handle(GEOM_InteractiveObject) GObject =
|
||||
Handle(GEOM_InteractiveObject)::DownCast(anObj);
|
||||
|
||||
GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( GObject->getIOR() );
|
||||
if ( aShape->_is_nil() )
|
||||
return false;
|
||||
|
||||
TopoDS_Shape Shape = ShapeReader.GetShape( myComponentGeom, aShape );
|
||||
if ( Shape.IsNull() )
|
||||
return false;
|
||||
|
||||
switch (myKind) {
|
||||
case StdSelect_AnyEdge:
|
||||
return Standard_True;
|
||||
case StdSelect_Line:
|
||||
{
|
||||
BRepAdaptor_Curve curv(TopoDS::Edge(Shape));
|
||||
return (curv.GetType() == GeomAbs_Line);
|
||||
}
|
||||
break;
|
||||
case StdSelect_Circle:
|
||||
BRepAdaptor_Curve curv(TopoDS::Edge(Shape));
|
||||
return (curv.GetType() == GeomAbs_Circle);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
106
src/GEOMFiltersSelection/GEOM_EdgeFilter.hxx
Normal file
106
src/GEOMFiltersSelection/GEOM_EdgeFilter.hxx
Normal file
@ -0,0 +1,106 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#ifndef _GEOM_EdgeFilter_HeaderFile
|
||||
#define _GEOM_EdgeFilter_HeaderFile
|
||||
|
||||
#ifndef _Handle_GEOM_EdgeFilter_HeaderFile
|
||||
#include "Handle_GEOM_EdgeFilter.hxx"
|
||||
#endif
|
||||
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#include "SALOME_Filter.hxx"
|
||||
|
||||
// IDL Headers
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(GEOM_Shape)
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
// Open CASCADE Includes
|
||||
#include <Standard.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <StdSelect_TypeOfEdge.hxx>
|
||||
|
||||
class GEOM_EdgeFilter : public SALOME_Filter {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOM_EdgeFilter(const StdSelect_TypeOfEdge Edge,
|
||||
GEOM::GEOM_Gen_ptr geom);
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SALOME_InteractiveObject)& anobj) const;
|
||||
Standard_EXPORT ~GEOM_EdgeFilter();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& GEOM_EdgeFilter_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
StdSelect_TypeOfEdge myKind;
|
||||
GEOM::GEOM_Gen_var myComponentGeom;
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
71
src/GEOMFiltersSelection/GEOM_EdgeFilter.ixx
Normal file
71
src/GEOMFiltersSelection/GEOM_EdgeFilter.ixx
Normal file
@ -0,0 +1,71 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOM_EdgeFilter.jxx"
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
GEOM_EdgeFilter::~GEOM_EdgeFilter() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOM_EdgeFilter_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_Filter);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_Filter);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOM_EdgeFilter",
|
||||
sizeof(GEOM_EdgeFilter),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOM_EdgeFilter) Handle(GEOM_EdgeFilter)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOM_EdgeFilter) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOM_EdgeFilter))) {
|
||||
_anOtherObject = Handle(GEOM_EdgeFilter)((Handle(GEOM_EdgeFilter)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOM_EdgeFilter::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOM_EdgeFilter) ;
|
||||
}
|
||||
Standard_Boolean GEOM_EdgeFilter::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(GEOM_EdgeFilter) == AType || SALOME_Filter::IsKind(AType));
|
||||
}
|
||||
Handle_GEOM_EdgeFilter::~Handle_GEOM_EdgeFilter() {}
|
||||
|
3
src/GEOMFiltersSelection/GEOM_EdgeFilter.jxx
Normal file
3
src/GEOMFiltersSelection/GEOM_EdgeFilter.jxx
Normal file
@ -0,0 +1,3 @@
|
||||
#ifndef _GEOM_EdgeFilter_HeaderFile
|
||||
#include "GEOM_EdgeFilter.hxx"
|
||||
#endif
|
164
src/GEOMFiltersSelection/GEOM_FaceFilter.cxx
Normal file
164
src/GEOMFiltersSelection/GEOM_FaceFilter.cxx
Normal file
@ -0,0 +1,164 @@
|
||||
using namespace std;
|
||||
// File : GEOM_FaceFilter.cxx
|
||||
// Created : Fri Dec 07 09:57:24 2001
|
||||
// Author : Nicolas REJNERI
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE
|
||||
// $Header$
|
||||
|
||||
#include "GEOM_FaceFilter.ixx"
|
||||
#include "GEOM_Client.hxx"
|
||||
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#include "GEOM_InteractiveObject.hxx"
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
#include "SALOME_TypeFilter.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
#include "QAD_Application.h"
|
||||
#include "QAD_Desktop.h"
|
||||
#include "QAD_Study.h"
|
||||
|
||||
// Open CASCADE Includes
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
|
||||
|
||||
static GEOM_Client ShapeReader;
|
||||
|
||||
/*!
|
||||
enumeration TypeOfFace is AnyFace,Plane,Cylinder,Sphere,Torus,Revol,Cone;
|
||||
*/
|
||||
GEOM_FaceFilter::GEOM_FaceFilter(const StdSelect_TypeOfFace Face,
|
||||
GEOM::GEOM_Gen_ptr geom)
|
||||
{
|
||||
myKind = Face;
|
||||
myComponentGeom = GEOM::GEOM_Gen::_narrow(geom);
|
||||
}
|
||||
|
||||
Standard_Boolean GEOM_FaceFilter::IsOk(const Handle(SALOME_InteractiveObject)& anObj) const
|
||||
{
|
||||
Handle(SALOME_TypeFilter) GeomFilter = new SALOME_TypeFilter( "GEOM" );
|
||||
if ( !GeomFilter->IsOk(anObj) )
|
||||
return false;
|
||||
|
||||
Handle(GEOM_ShapeTypeFilter) GeomShapeTypeFilter = new GEOM_ShapeTypeFilter( TopAbs_FACE, myComponentGeom );
|
||||
if ( !GeomShapeTypeFilter->IsOk(anObj) )
|
||||
return false;
|
||||
|
||||
if ( anObj->hasEntry() ) {
|
||||
QAD_Study* ActiveStudy = QAD_Application::getDesktop()->getActiveStudy();
|
||||
SALOMEDS::Study_var aStudy = ActiveStudy->getStudyDocument();
|
||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( anObj->getEntry() );
|
||||
SALOMEDS::GenericAttribute_var anAttr;
|
||||
SALOMEDS::AttributeIOR_var anIOR;
|
||||
if ( !obj->_is_nil() ) {
|
||||
if (obj->FindAttribute(anAttr, "AttributeIOR")) {
|
||||
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||
GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( anIOR->Value() );
|
||||
if ( aShape->_is_nil() )
|
||||
return false;
|
||||
|
||||
TopoDS_Shape Shape = ShapeReader.GetShape( myComponentGeom, aShape );
|
||||
if ( Shape.IsNull() )
|
||||
return false;
|
||||
|
||||
switch (myKind) {
|
||||
case StdSelect_AnyFace:
|
||||
return Standard_True;
|
||||
case StdSelect_Plane:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Plane);
|
||||
}
|
||||
case StdSelect_Cylinder:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Cylinder);
|
||||
}
|
||||
case StdSelect_Sphere:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Sphere);
|
||||
}
|
||||
case StdSelect_Torus:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return ( surf.GetType() == GeomAbs_Torus);
|
||||
}
|
||||
case StdSelect_Revol:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return ( surf.GetType() == GeomAbs_Cylinder ||
|
||||
surf.GetType() == GeomAbs_Cone ||
|
||||
surf.GetType() == GeomAbs_Torus ||
|
||||
surf.GetType() == GeomAbs_Sphere ||
|
||||
surf.GetType() == GeomAbs_SurfaceOfRevolution );
|
||||
}
|
||||
case StdSelect_Cone: // en attendant la liberation du cdl, on l'utilise pour Cone
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Cone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( anObj->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) {
|
||||
Handle(GEOM_InteractiveObject) GObject =
|
||||
Handle(GEOM_InteractiveObject)::DownCast(anObj);
|
||||
|
||||
GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( GObject->getIOR() );
|
||||
if ( aShape->_is_nil() )
|
||||
return false;
|
||||
|
||||
TopoDS_Shape Shape = ShapeReader.GetShape( myComponentGeom, aShape );
|
||||
if ( Shape.IsNull() )
|
||||
return false;
|
||||
|
||||
switch (myKind) {
|
||||
case StdSelect_AnyFace:
|
||||
return Standard_True;
|
||||
case StdSelect_Plane:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Plane);
|
||||
}
|
||||
case StdSelect_Cylinder:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Cylinder);
|
||||
}
|
||||
case StdSelect_Sphere:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Sphere);
|
||||
}
|
||||
case StdSelect_Torus:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return ( surf.GetType() == GeomAbs_Torus);
|
||||
}
|
||||
case StdSelect_Revol:
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return ( surf.GetType() == GeomAbs_Cylinder ||
|
||||
surf.GetType() == GeomAbs_Cone ||
|
||||
surf.GetType() == GeomAbs_Torus ||
|
||||
surf.GetType() == GeomAbs_Sphere ||
|
||||
surf.GetType() == GeomAbs_SurfaceOfRevolution );
|
||||
}
|
||||
case StdSelect_Cone: // en attendant la liberation du cdl, on l'utilise pour Cone
|
||||
{
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(Shape));
|
||||
return (surf.GetType() == GeomAbs_Cone);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
106
src/GEOMFiltersSelection/GEOM_FaceFilter.hxx
Normal file
106
src/GEOMFiltersSelection/GEOM_FaceFilter.hxx
Normal file
@ -0,0 +1,106 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#ifndef _GEOM_FaceFilter_HeaderFile
|
||||
#define _GEOM_FaceFilter_HeaderFile
|
||||
|
||||
#ifndef _Handle_GEOM_FaceFilter_HeaderFile
|
||||
#include "Handle_GEOM_FaceFilter.hxx"
|
||||
#endif
|
||||
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#include "SALOME_Filter.hxx"
|
||||
|
||||
// IDL Headers
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(GEOM_Shape)
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
// Open CASCADE Includes
|
||||
#include <Standard.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <StdSelect_TypeOfFace.hxx>
|
||||
|
||||
class GEOM_FaceFilter : public SALOME_Filter {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOM_FaceFilter(const StdSelect_TypeOfFace Face,
|
||||
GEOM::GEOM_Gen_ptr geom);
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SALOME_InteractiveObject)& anobj) const;
|
||||
Standard_EXPORT ~GEOM_FaceFilter();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& GEOM_FaceFilter_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
StdSelect_TypeOfFace myKind;
|
||||
GEOM::GEOM_Gen_var myComponentGeom;
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
71
src/GEOMFiltersSelection/GEOM_FaceFilter.ixx
Normal file
71
src/GEOMFiltersSelection/GEOM_FaceFilter.ixx
Normal file
@ -0,0 +1,71 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOM_FaceFilter.jxx"
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
GEOM_FaceFilter::~GEOM_FaceFilter() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOM_FaceFilter_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_Filter);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_Filter);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOM_FaceFilter",
|
||||
sizeof(GEOM_FaceFilter),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOM_FaceFilter) Handle(GEOM_FaceFilter)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOM_FaceFilter) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOM_FaceFilter))) {
|
||||
_anOtherObject = Handle(GEOM_FaceFilter)((Handle(GEOM_FaceFilter)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOM_FaceFilter::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOM_FaceFilter) ;
|
||||
}
|
||||
Standard_Boolean GEOM_FaceFilter::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(GEOM_FaceFilter) == AType || SALOME_Filter::IsKind(AType));
|
||||
}
|
||||
Handle_GEOM_FaceFilter::~Handle_GEOM_FaceFilter() {}
|
||||
|
3
src/GEOMFiltersSelection/GEOM_FaceFilter.jxx
Normal file
3
src/GEOMFiltersSelection/GEOM_FaceFilter.jxx
Normal file
@ -0,0 +1,3 @@
|
||||
#ifndef _GEOM_FaceFilter_HeaderFile
|
||||
#include "GEOM_FaceFilter.hxx"
|
||||
#endif
|
89
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx
Normal file
89
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx
Normal file
@ -0,0 +1,89 @@
|
||||
using namespace std;
|
||||
// File : GEOM_ShapeTypeFilter.cxx
|
||||
// Created : Fri Dec 07 09:57:24 2001
|
||||
// Author : Nicolas REJNERI
|
||||
// Project : SALOME
|
||||
// Module : SALOMEGUI
|
||||
// Copyright : Open CASCADE
|
||||
// $Header$
|
||||
|
||||
#include "GEOM_ShapeTypeFilter.ixx"
|
||||
#include "GEOM_Client.hxx"
|
||||
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#include "GEOM_InteractiveObject.hxx"
|
||||
#include "SALOME_TypeFilter.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
#include "QAD_Application.h"
|
||||
#include "QAD_Desktop.h"
|
||||
#include "QAD_Study.h"
|
||||
|
||||
static GEOM_Client ShapeReader;
|
||||
|
||||
GEOM_ShapeTypeFilter::GEOM_ShapeTypeFilter(TopAbs_ShapeEnum ShapeType,
|
||||
GEOM::GEOM_Gen_ptr geom)
|
||||
{
|
||||
myKind = ShapeType;
|
||||
myComponentGeom = GEOM::GEOM_Gen::_narrow(geom);
|
||||
}
|
||||
|
||||
Standard_Boolean GEOM_ShapeTypeFilter::IsOk(const Handle(SALOME_InteractiveObject)& anObj) const
|
||||
{
|
||||
Handle(SALOME_TypeFilter) GeomFilter = new SALOME_TypeFilter( "GEOM" );
|
||||
if ( !GeomFilter->IsOk(anObj) )
|
||||
return false;
|
||||
if ( anObj->hasEntry() ) {
|
||||
QAD_Study* ActiveStudy = QAD_Application::getDesktop()->getActiveStudy();
|
||||
SALOMEDS::Study_var aStudy = ActiveStudy->getStudyDocument();
|
||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( anObj->getEntry() );
|
||||
SALOMEDS::GenericAttribute_var anAttr;
|
||||
SALOMEDS::AttributeIOR_var anIOR;
|
||||
if ( !obj->_is_nil() ) {
|
||||
if (obj->FindAttribute(anAttr, "AttributeIOR")) {
|
||||
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||
GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( anIOR->Value() );
|
||||
if ( aShape->_is_nil() )
|
||||
return false;
|
||||
|
||||
TopoDS_Shape Shape = ShapeReader.GetShape( myComponentGeom, aShape );
|
||||
if ( Shape.IsNull() )
|
||||
return false;
|
||||
|
||||
MESSAGE ( " myKind = " << myKind );
|
||||
MESSAGE ( " Shape.ShapeType = " << Shape.ShapeType() );
|
||||
if ( myKind == TopAbs_SHAPE )
|
||||
return true;
|
||||
|
||||
if ( Shape.ShapeType() == myKind )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( anObj->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) {
|
||||
Handle(GEOM_InteractiveObject) GObject =
|
||||
Handle(GEOM_InteractiveObject)::DownCast(anObj);
|
||||
|
||||
GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( GObject->getIOR() );
|
||||
if ( aShape->_is_nil() )
|
||||
return false;
|
||||
|
||||
TopoDS_Shape Shape = ShapeReader.GetShape( myComponentGeom, aShape );
|
||||
if ( Shape.IsNull() )
|
||||
return false;
|
||||
|
||||
MESSAGE ( " myKind = " << myKind );
|
||||
MESSAGE ( " Shape.ShapeType = " << Shape.ShapeType() );
|
||||
if ( myKind == TopAbs_SHAPE )
|
||||
return true;
|
||||
|
||||
if ( Shape.ShapeType() == myKind )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
104
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.hxx
Normal file
104
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.hxx
Normal file
@ -0,0 +1,104 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#ifndef _GEOM_ShapeTypeFilter_HeaderFile
|
||||
#define _GEOM_ShapeTypeFilter_HeaderFile
|
||||
|
||||
#ifndef _Handle_GEOM_ShapeTypeFilter_HeaderFile
|
||||
#include "Handle_GEOM_ShapeTypeFilter.hxx"
|
||||
#endif
|
||||
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#include "SALOME_Filter.hxx"
|
||||
|
||||
// IDL Headers
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(GEOM_Shape)
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
// Open CASCADE Includes
|
||||
#include <Standard.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
class GEOM_ShapeTypeFilter : public SALOME_Filter {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOM_ShapeTypeFilter(TopAbs_ShapeEnum ShapeType,
|
||||
GEOM::GEOM_Gen_ptr geom);
|
||||
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SALOME_InteractiveObject)& anobj) const;
|
||||
Standard_EXPORT ~GEOM_ShapeTypeFilter();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& GEOM_ShapeTypeFilter_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
TopAbs_ShapeEnum myKind;
|
||||
GEOM::GEOM_Gen_var myComponentGeom;
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
71
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.ixx
Normal file
71
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.ixx
Normal file
@ -0,0 +1,71 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOM_ShapeTypeFilter.jxx"
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
GEOM_ShapeTypeFilter::~GEOM_ShapeTypeFilter() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOM_ShapeTypeFilter_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_Filter);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_Filter);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOM_ShapeTypeFilter",
|
||||
sizeof(GEOM_ShapeTypeFilter),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOM_ShapeTypeFilter) Handle(GEOM_ShapeTypeFilter)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOM_ShapeTypeFilter) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOM_ShapeTypeFilter))) {
|
||||
_anOtherObject = Handle(GEOM_ShapeTypeFilter)((Handle(GEOM_ShapeTypeFilter)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOM_ShapeTypeFilter::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOM_ShapeTypeFilter) ;
|
||||
}
|
||||
Standard_Boolean GEOM_ShapeTypeFilter::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(GEOM_ShapeTypeFilter) == AType || SALOME_Filter::IsKind(AType));
|
||||
}
|
||||
Handle_GEOM_ShapeTypeFilter::~Handle_GEOM_ShapeTypeFilter() {}
|
||||
|
3
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.jxx
Normal file
3
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.jxx
Normal file
@ -0,0 +1,3 @@
|
||||
#ifndef _GEOM_ShapeTypeFilter_HeaderFile
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
#endif
|
89
src/GEOMFiltersSelection/Handle_GEOM_EdgeFilter.hxx
Normal file
89
src/GEOMFiltersSelection/Handle_GEOM_EdgeFilter.hxx
Normal file
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _Handle_GEOM_EdgeFilter_HeaderFile
|
||||
#define _Handle_GEOM_EdgeFilter_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_SALOME_Filter_HeaderFile
|
||||
#include "Handle_SALOME_Filter.hxx"
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(SALOME_Filter);
|
||||
class GEOM_EdgeFilter;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_EdgeFilter);
|
||||
|
||||
class Handle(GEOM_EdgeFilter) : public Handle(SALOME_Filter) {
|
||||
public:
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
Handle(GEOM_EdgeFilter)():Handle(SALOME_Filter)() {}
|
||||
Handle(GEOM_EdgeFilter)(const Handle(GEOM_EdgeFilter)& aHandle) : Handle(SALOME_Filter)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_EdgeFilter)(const GEOM_EdgeFilter* anItem) : Handle(SALOME_Filter)((SALOME_Filter *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_EdgeFilter)& operator=(const Handle(GEOM_EdgeFilter)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(GEOM_EdgeFilter)& operator=(const GEOM_EdgeFilter* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEOM_EdgeFilter* operator->()
|
||||
{
|
||||
return (GEOM_EdgeFilter *)ControlAccess();
|
||||
}
|
||||
|
||||
GEOM_EdgeFilter* operator->() const
|
||||
{
|
||||
return (GEOM_EdgeFilter *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(GEOM_EdgeFilter)();
|
||||
|
||||
Standard_EXPORT static const Handle(GEOM_EdgeFilter) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
89
src/GEOMFiltersSelection/Handle_GEOM_FaceFilter.hxx
Normal file
89
src/GEOMFiltersSelection/Handle_GEOM_FaceFilter.hxx
Normal file
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _Handle_GEOM_FaceFilter_HeaderFile
|
||||
#define _Handle_GEOM_FaceFilter_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_SALOME_Filter_HeaderFile
|
||||
#include "Handle_SALOME_Filter.hxx"
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(SALOME_Filter);
|
||||
class GEOM_FaceFilter;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_FaceFilter);
|
||||
|
||||
class Handle(GEOM_FaceFilter) : public Handle(SALOME_Filter) {
|
||||
public:
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
Handle(GEOM_FaceFilter)():Handle(SALOME_Filter)() {}
|
||||
Handle(GEOM_FaceFilter)(const Handle(GEOM_FaceFilter)& aHandle) : Handle(SALOME_Filter)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_FaceFilter)(const GEOM_FaceFilter* anItem) : Handle(SALOME_Filter)((SALOME_Filter *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_FaceFilter)& operator=(const Handle(GEOM_FaceFilter)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(GEOM_FaceFilter)& operator=(const GEOM_FaceFilter* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEOM_FaceFilter* operator->()
|
||||
{
|
||||
return (GEOM_FaceFilter *)ControlAccess();
|
||||
}
|
||||
|
||||
GEOM_FaceFilter* operator->() const
|
||||
{
|
||||
return (GEOM_FaceFilter *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(GEOM_FaceFilter)();
|
||||
|
||||
Standard_EXPORT static const Handle(GEOM_FaceFilter) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
89
src/GEOMFiltersSelection/Handle_GEOM_ShapeTypeFilter.hxx
Normal file
89
src/GEOMFiltersSelection/Handle_GEOM_ShapeTypeFilter.hxx
Normal file
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _Handle_GEOM_ShapeTypeFilter_HeaderFile
|
||||
#define _Handle_GEOM_ShapeTypeFilter_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_SALOME_Filter_HeaderFile
|
||||
#include "Handle_SALOME_Filter.hxx"
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(SALOME_Filter);
|
||||
class GEOM_ShapeTypeFilter;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_ShapeTypeFilter);
|
||||
|
||||
class Handle(GEOM_ShapeTypeFilter) : public Handle(SALOME_Filter) {
|
||||
public:
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
Handle(GEOM_ShapeTypeFilter)():Handle(SALOME_Filter)() {}
|
||||
Handle(GEOM_ShapeTypeFilter)(const Handle(GEOM_ShapeTypeFilter)& aHandle) : Handle(SALOME_Filter)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_ShapeTypeFilter)(const GEOM_ShapeTypeFilter* anItem) : Handle(SALOME_Filter)((SALOME_Filter *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_ShapeTypeFilter)& operator=(const Handle(GEOM_ShapeTypeFilter)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(GEOM_ShapeTypeFilter)& operator=(const GEOM_ShapeTypeFilter* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEOM_ShapeTypeFilter* operator->()
|
||||
{
|
||||
return (GEOM_ShapeTypeFilter *)ControlAccess();
|
||||
}
|
||||
|
||||
GEOM_ShapeTypeFilter* operator->() const
|
||||
{
|
||||
return (GEOM_ShapeTypeFilter *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(GEOM_ShapeTypeFilter)();
|
||||
|
||||
Standard_EXPORT static const Handle(GEOM_ShapeTypeFilter) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
45
src/GEOMFiltersSelection/Makefile.in
Normal file
45
src/GEOMFiltersSelection/Makefile.in
Normal file
@ -0,0 +1,45 @@
|
||||
# -* Makefile *-
|
||||
#
|
||||
# Author : Patrick GOLDBRONN (CEA)
|
||||
# Date : 29/06/2001
|
||||
# $Header$
|
||||
#
|
||||
|
||||
# source path
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
VPATH=.:$(srcdir):$(top_srcdir)/idl:$(top_builddir)/idl
|
||||
|
||||
|
||||
@COMMENCE@
|
||||
|
||||
# Libraries targets
|
||||
|
||||
LIB = libGeometryFiltersSelection.la
|
||||
LIB_SRC = GEOM_ShapeTypeFilter.cxx \
|
||||
GEOM_FaceFilter.cxx \
|
||||
GEOM_EdgeFilter.cxx
|
||||
|
||||
LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS= GEOM_ShapeTypeFilter.hxx \
|
||||
Handle_GEOM_ShapeTypeFilter.hxx \
|
||||
GEOM_FaceFilter.hxx \
|
||||
Handle_GEOM_FaceFilter.hxx \
|
||||
GEOM_EdgeFilter.hxx \
|
||||
Handle_GEOM_EdgeFilter.hxx
|
||||
|
||||
# additionnal information to compil and link file
|
||||
CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES)
|
||||
CXXFLAGS += $(OCC_CXXFLAGS)
|
||||
LDFLAGS += $(OCC_LIBS)
|
||||
|
||||
# additional file to be cleaned
|
||||
MOSTLYCLEAN =
|
||||
CLEAN =
|
||||
DISTCLEAN =
|
||||
|
||||
@CONCLUDE@
|
||||
|
127
src/OBJECT/GEOM_AISShape.cxx
Normal file
127
src/OBJECT/GEOM_AISShape.cxx
Normal file
@ -0,0 +1,127 @@
|
||||
using namespace std;
|
||||
// File : GEOM_AISShape.cxx
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Nicolas REJNERI
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
/*!
|
||||
\class GEOM_AISShape GEOM_AISShape.hxx
|
||||
\brief ....
|
||||
*/
|
||||
|
||||
#include "GEOM_AISShape.ixx"
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
// Open CASCADE Includes
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <StdSelect_DisplayMode.hxx>
|
||||
#include <StdPrs_WFShape.hxx>
|
||||
#include <StdPrs_ShadedShape.hxx>
|
||||
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
|
||||
GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
|
||||
const Standard_CString aName): SALOME_AISShape(shape)
|
||||
{
|
||||
myIO = NULL;
|
||||
myName = new char [strlen(aName)+1];
|
||||
strcpy( myName, aName);
|
||||
|
||||
myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
|
||||
}
|
||||
|
||||
void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){
|
||||
myIO = io;
|
||||
}
|
||||
|
||||
Handle(SALOME_InteractiveObject) GEOM_AISShape::getIO(){
|
||||
return myIO;
|
||||
}
|
||||
|
||||
Standard_Boolean GEOM_AISShape::hasIO(){
|
||||
return !( myIO == NULL ) ;
|
||||
}
|
||||
|
||||
void GEOM_AISShape::setName(const Standard_CString aName)
|
||||
{
|
||||
myName = new char [strlen(aName)+1];
|
||||
strcpy( myName, aName);
|
||||
|
||||
if ( hasIO() )
|
||||
myIO->setName(aName);
|
||||
}
|
||||
|
||||
Standard_CString GEOM_AISShape::getName(){
|
||||
return myName;
|
||||
}
|
||||
|
||||
void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
|
||||
const Handle(Prs3d_Presentation)& aPrs,
|
||||
const Standard_Integer aMode)
|
||||
{
|
||||
if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
|
||||
|
||||
StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
|
||||
|
||||
switch (d) {
|
||||
case StdSelect_DM_Wireframe:
|
||||
{
|
||||
StdPrs_WFShape::Add(aPrs,myshape,myDrawer);
|
||||
break;
|
||||
}
|
||||
case StdSelect_DM_Shading:
|
||||
{
|
||||
myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn();
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(Graphic3d_NOM_BRASS);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Graphic3d_NOM_JADE);
|
||||
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
FMat.SetTransparency(myTransparency); BMat.SetTransparency(myTransparency);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
|
||||
//Handle(Graphic3d_AspectFillArea3d) a4bis = myDrawer->ShadingAspect()->Aspect();
|
||||
// P->SetPrimitivesAspect(a4bis);
|
||||
// G->SetGroupPrimitivesAspect(a4bis);
|
||||
//a4bis->SetInteriorColor(myShadingColor);
|
||||
myDrawer->ShadingAspect()->SetColor(myShadingColor);
|
||||
|
||||
StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// aPrs->ReCompute(); // for hidden line recomputation if necessary...
|
||||
}
|
||||
|
||||
void GEOM_AISShape::SetTransparency(const Standard_Real aValue)
|
||||
{
|
||||
if(aValue<0.0 || aValue>1.0) return;
|
||||
|
||||
if(aValue<=0.05)
|
||||
{
|
||||
UnsetTransparency();
|
||||
return;
|
||||
}
|
||||
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
FMat.SetTransparency(aValue); BMat.SetTransparency(aValue);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
myTransparency = aValue;
|
||||
}
|
||||
|
||||
void GEOM_AISShape::SetShadingColor(const Quantity_Color &aCol)
|
||||
{
|
||||
myShadingColor = aCol;
|
||||
}
|
125
src/OBJECT/GEOM_AISShape.hxx
Normal file
125
src/OBJECT/GEOM_AISShape.hxx
Normal file
@ -0,0 +1,125 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#ifndef _GEOM_AISShape_HeaderFile
|
||||
#define _GEOM_AISShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOM_AISShape_HeaderFile
|
||||
#include "Handle_GEOM_AISShape.hxx"
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
|
||||
#include "Handle_SALOME_InteractiveObject.hxx"
|
||||
#endif
|
||||
#ifndef _Standard_CString_HeaderFile
|
||||
#include <Standard_CString.hxx>
|
||||
#endif
|
||||
#ifndef _SALOME_AISShape_HeaderFile
|
||||
#include "SALOME_AISShape.hxx"
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_PrsMgr_PresentationManager3d_HeaderFile
|
||||
#include <Handle_PrsMgr_PresentationManager3d.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Prs3d_Presentation_HeaderFile
|
||||
#include <Handle_Prs3d_Presentation.hxx>
|
||||
#endif
|
||||
|
||||
class PrsMgr_PresentationManager3d;
|
||||
class Prs3d_Presentation;
|
||||
class SALOME_InteractiveObject;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
class GEOM_AISShape : public SALOME_AISShape {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOM_AISShape(const TopoDS_Shape& shape, const Standard_CString aName);
|
||||
Standard_EXPORT Standard_Boolean hasIO() ;
|
||||
Standard_EXPORT void setIO(const Handle(SALOME_InteractiveObject)& name) ;
|
||||
Standard_EXPORT void setName(const Standard_CString aName) ;
|
||||
Standard_EXPORT Standard_CString getName() ;
|
||||
Standard_EXPORT Handle_SALOME_InteractiveObject getIO() ;
|
||||
Standard_EXPORT ~GEOM_AISShape();
|
||||
|
||||
Standard_EXPORT void SetTransparency(const Standard_Real aValue);
|
||||
Standard_EXPORT void SetShadingColor(const Quantity_Color &aCol);
|
||||
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer aMode = 0) ;
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& GEOM_AISShape_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Handle_SALOME_InteractiveObject myIO;
|
||||
Standard_CString myName;
|
||||
Quantity_Color myShadingColor;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
79
src/OBJECT/GEOM_AISShape.ixx
Normal file
79
src/OBJECT/GEOM_AISShape.ixx
Normal file
@ -0,0 +1,79 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOM_AISShape.jxx"
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
GEOM_AISShape::~GEOM_AISShape() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOM_AISShape_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_AISShape);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_AISShape);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_Shape);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_Shape);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(AIS_InteractiveObject);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(AIS_InteractiveObject);
|
||||
static Handle_Standard_Type aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
|
||||
if ( aType4.IsNull()) aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
|
||||
static Handle_Standard_Type aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
|
||||
if ( aType5.IsNull()) aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
|
||||
static Handle_Standard_Type aType6 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType6.IsNull()) aType6 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType7 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType7.IsNull()) aType7 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,aType7,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOM_AISShape",
|
||||
sizeof(GEOM_AISShape),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOM_AISShape) Handle(GEOM_AISShape)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOM_AISShape) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOM_AISShape))) {
|
||||
_anOtherObject = Handle(GEOM_AISShape)((Handle(GEOM_AISShape)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOM_AISShape::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOM_AISShape) ;
|
||||
}
|
||||
Standard_Boolean GEOM_AISShape::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(GEOM_AISShape) == AType || SALOME_AISShape::IsKind(AType));
|
||||
}
|
||||
Handle_GEOM_AISShape::~Handle_GEOM_AISShape() {}
|
||||
|
15
src/OBJECT/GEOM_AISShape.jxx
Normal file
15
src/OBJECT/GEOM_AISShape.jxx
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef _GEOM_InteractiveObject_HeaderFile
|
||||
#include "GEOM_InteractiveObject.hxx"
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _GEOM_AISShape_HeaderFile
|
||||
#include "GEOM_AISShape.hxx"
|
||||
#endif
|
||||
#ifndef _PrsMgr_PresentationManager3d_HeaderFile
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#endif
|
||||
#ifndef _Prs3d_Presentation_HeaderFile
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#endif
|
450
src/OBJECT/GEOM_Actor.cxx
Normal file
450
src/OBJECT/GEOM_Actor.cxx
Normal file
@ -0,0 +1,450 @@
|
||||
using namespace std;
|
||||
// File : GEOM_Actor.cxx
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Christophe ATTANASIO
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
/*!
|
||||
\class GEOM_Actor GEOM_Actor.h
|
||||
\brief This class allows to display an OpenCASCADE CAD model in a VTK viewer.
|
||||
*/
|
||||
|
||||
#include "GEOM_Actor.h"
|
||||
|
||||
// VTK Includes
|
||||
#include <vtkObjectFactory.h>
|
||||
#include <vtkPolyDataMapper.h>
|
||||
#include <vtkPolyDataNormals.h>
|
||||
#include <vtkMath.h>
|
||||
|
||||
// OpenCASCADE Includes
|
||||
#include "GEOM_OCCReader.h"
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Main methods
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
GEOM_Actor* GEOM_Actor::New()
|
||||
{
|
||||
// First try to create the object from the vtkObjectFactory
|
||||
vtkObject* ret = vtkObjectFactory::CreateInstance("GEOM_Actor");
|
||||
if(ret)
|
||||
{
|
||||
return (GEOM_Actor*)ret;
|
||||
}
|
||||
// If the factory was unable to create the object, then create it here.
|
||||
return new GEOM_Actor;
|
||||
}
|
||||
|
||||
|
||||
GEOM_Actor::GEOM_Actor()
|
||||
{
|
||||
this->Device = vtkActor::New();
|
||||
|
||||
this->WireframeMapper = NULL;
|
||||
this->ShadingMapper = NULL;
|
||||
|
||||
this->ShadingProperty = NULL;
|
||||
this->WireframeProperty = NULL;
|
||||
|
||||
this->deflection = 0;
|
||||
myDisplayMode = 0;
|
||||
|
||||
this->myIO = NULL;
|
||||
this->myName = "";
|
||||
|
||||
this->HighlightProperty = NULL;
|
||||
this->ishighlighted = false;
|
||||
|
||||
this->subshape = false;
|
||||
}
|
||||
|
||||
GEOM_Actor::~GEOM_Actor()
|
||||
{
|
||||
if (WireframeMapper != NULL)
|
||||
WireframeMapper->Delete();
|
||||
if (ShadingMapper != NULL)
|
||||
ShadingMapper->Delete();
|
||||
if (ShadingProperty != NULL)
|
||||
ShadingProperty->Delete();
|
||||
if (WireframeProperty != NULL)
|
||||
WireframeProperty->Delete();
|
||||
if (HighlightProperty != NULL)
|
||||
HighlightProperty->Delete();
|
||||
}
|
||||
|
||||
|
||||
void GEOM_Actor::ShallowCopy(vtkProp *prop)
|
||||
{
|
||||
GEOM_Actor *f = GEOM_Actor::SafeDownCast(prop);
|
||||
if ( f != NULL )
|
||||
{
|
||||
this->setInputShape(f->getTopo(),f->getDeflection(),f->getDisplayMode());
|
||||
this->setName( f->getName() );
|
||||
if ( f->hasIO() )
|
||||
this->setIO( f->getIO() );
|
||||
this->ShadingMapper = NULL;
|
||||
this->WireframeMapper = NULL;
|
||||
} else {
|
||||
this->myIO = NULL;
|
||||
this->myName = "";
|
||||
this->ShadingMapper = NULL;
|
||||
this->WireframeMapper = NULL;
|
||||
}
|
||||
|
||||
// Now do superclass
|
||||
this->SALOME_Actor::ShallowCopy(prop);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Set parameters
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
void GEOM_Actor::setDisplayMode(int thenewmode) {
|
||||
myDisplayMode = thenewmode;
|
||||
if ( thenewmode >=1 ) {
|
||||
if ((myShape.ShapeType() == TopAbs_WIRE) ||
|
||||
(myShape.ShapeType() == TopAbs_EDGE) ||
|
||||
(myShape.ShapeType() == TopAbs_VERTEX)) {
|
||||
if ( !subshape )
|
||||
CreateWireframeMapper();
|
||||
else
|
||||
return;
|
||||
} else
|
||||
CreateShadingMapper();
|
||||
} else
|
||||
CreateWireframeMapper();
|
||||
}
|
||||
|
||||
void GEOM_Actor::setDeflection(double adef) {
|
||||
deflection = adef;
|
||||
}
|
||||
|
||||
void GEOM_Actor::setInputShape(const TopoDS_Shape& aShape,double adef,int imode) {
|
||||
myShape = aShape;
|
||||
deflection = adef;
|
||||
setDisplayMode(imode);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Get parameters
|
||||
//-------------------------------------------------------------
|
||||
|
||||
const TopoDS_Shape& GEOM_Actor::getTopo() {
|
||||
return myShape;
|
||||
}
|
||||
|
||||
double GEOM_Actor::getDeflection() {
|
||||
return deflection;
|
||||
}
|
||||
|
||||
void GEOM_Actor::SetWireframeProperty(vtkProperty* Prop) {
|
||||
this->WireframeProperty = Prop;
|
||||
}
|
||||
|
||||
void GEOM_Actor::SetShadingProperty(vtkProperty* Prop) {
|
||||
this->ShadingProperty = Prop;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Mapper creating function
|
||||
//-------------------------------------------------------------
|
||||
void GEOM_Actor::CreateMapper(int theMode) {
|
||||
if(myShape.ShapeType() == TopAbs_VERTEX) {
|
||||
gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(myShape));
|
||||
this->SetPosition(aPnt.X(),aPnt.Y(),aPnt.Z());
|
||||
}
|
||||
GEOM_OCCReader* aread = GEOM_OCCReader::New();
|
||||
aread->setTopo(myShape);
|
||||
aread->setDisplayMode(theMode);
|
||||
aread->GetOutput()->ReleaseDataFlagOn();
|
||||
|
||||
vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
|
||||
if (theMode == 0) {
|
||||
aMapper->SetInput(aread->GetOutput());
|
||||
} else {
|
||||
vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
|
||||
normals->SetInput(aread->GetOutput());
|
||||
aMapper->SetInput(normals->GetOutput());
|
||||
}
|
||||
aread->Delete();
|
||||
this->SetMapper(theMode == 0? WireframeMapper = aMapper : ShadingMapper = aMapper);
|
||||
}
|
||||
|
||||
void GEOM_Actor::CreateShadingMapper() {
|
||||
CreateMapper(1);
|
||||
}
|
||||
|
||||
|
||||
void GEOM_Actor::CreateWireframeMapper() {
|
||||
CreateMapper(0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Render function
|
||||
//-------------------------------------------------------------
|
||||
|
||||
void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *Mapper)
|
||||
{
|
||||
/* render the property */
|
||||
if (!this->Property) {
|
||||
// force creation of a property
|
||||
this->GetProperty();
|
||||
this->Property->SetInterpolation(1);
|
||||
this->Property->SetRepresentationToSurface();
|
||||
this->Property->SetAmbient(0.3);
|
||||
this->Property->SetAmbientColor(0.88,0.86,0.2);
|
||||
this->Property->SetDiffuseColor(0.99,0.7,0.21);
|
||||
this->Property->SetSpecularColor(0.99,0.98,0.83);
|
||||
}
|
||||
|
||||
if(!ishighlighted) {
|
||||
if(myDisplayMode >= 1) {
|
||||
// SHADING
|
||||
this->Property = ShadingProperty;
|
||||
}
|
||||
else {
|
||||
this->Property = WireframeProperty;
|
||||
}
|
||||
|
||||
if ( ispreselected )
|
||||
this->Property = PreviewProperty;
|
||||
}
|
||||
|
||||
this->Property->Render(this, ren);
|
||||
if (this->BackfaceProperty) {
|
||||
this->BackfaceProperty->BackfaceRender(this, ren);
|
||||
this->Device->SetBackfaceProperty(this->BackfaceProperty);
|
||||
}
|
||||
this->Device->SetProperty(this->Property);
|
||||
// Store information on time it takes to render.
|
||||
// We might want to estimate time from the number of polygons in mapper.
|
||||
if(myDisplayMode >= 1) {
|
||||
if((myShape.ShapeType() == TopAbs_WIRE) ||
|
||||
(myShape.ShapeType() == TopAbs_EDGE) ||
|
||||
(myShape.ShapeType() == TopAbs_VERTEX)) {
|
||||
if ( !subshape ) {
|
||||
if(WireframeMapper==NULL) CreateWireframeMapper();
|
||||
} else
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if(ShadingMapper==NULL) CreateShadingMapper();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(WireframeMapper==NULL) CreateWireframeMapper();
|
||||
}
|
||||
if(myShape.ShapeType() == TopAbs_VERTEX) {
|
||||
if(ren){
|
||||
//The parameter determine size of vertex actor relate to diagonal of RendererWindow
|
||||
static float delta = 0.01;
|
||||
float X1 = -1, Y1 = -1, Z1 = 0;
|
||||
ren->ViewToWorld(X1,Y1,Z1);
|
||||
float X2 = +1, Y2 = +1, Z2 = 0;
|
||||
ren->ViewToWorld(X2,Y2,Z2);
|
||||
Z2 = sqrt((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1) + (Z2-Z1)*(Z2-Z1));
|
||||
this->SetScale(Z2*delta);
|
||||
}
|
||||
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
|
||||
this->GetMatrix(ren->GetActiveCamera(), aMatrix);
|
||||
this->Device->SetUserMatrix(aMatrix);
|
||||
this->Device->Render(ren,this->Mapper);
|
||||
aMatrix->Delete();
|
||||
} else
|
||||
this->Device->Render(ren, this->Mapper);
|
||||
this->EstimatedRenderTime = WireframeMapper->GetTimeToDraw();
|
||||
}
|
||||
|
||||
// SubShape
|
||||
void GEOM_Actor::SubShapeOn()
|
||||
{
|
||||
subshape = true;
|
||||
}
|
||||
void GEOM_Actor::SubShapeOff()
|
||||
{
|
||||
subshape = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Opacity methods
|
||||
//-------------------------------------------------------------
|
||||
|
||||
void GEOM_Actor::SetOpacity(float opa)
|
||||
{
|
||||
//HighlightProperty->SetOpacity(opa);
|
||||
SALOME_Actor::SetOpacity(opa);
|
||||
ShadingProperty->SetOpacity(opa);
|
||||
}
|
||||
|
||||
float GEOM_Actor::GetOpacity() {
|
||||
return ShadingProperty->GetOpacity();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Color methods
|
||||
//-------------------------------------------------------------
|
||||
void GEOM_Actor::SetColor(float r,float g,float b) {
|
||||
ShadingProperty->SetColor(r,g,b);
|
||||
}
|
||||
|
||||
void GEOM_Actor::GetColor(float& r,float& g,float& b) {
|
||||
float color[3];
|
||||
ShadingProperty->GetColor(color);
|
||||
r = color[0];
|
||||
g = color[1];
|
||||
b = color[2];
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Highlight methods
|
||||
//-------------------------------------------------------------
|
||||
|
||||
void GEOM_Actor::highlight(Standard_Boolean highlight) {
|
||||
|
||||
if(highlight && !ishighlighted) {
|
||||
ishighlighted=true;
|
||||
// build highlight property is necessary
|
||||
if(HighlightProperty==NULL) {
|
||||
HighlightProperty = vtkProperty::New();
|
||||
HighlightProperty->SetAmbient(0.5);
|
||||
HighlightProperty->SetDiffuse(0.3);
|
||||
HighlightProperty->SetSpecular(0.2);
|
||||
HighlightProperty->SetRepresentationToSurface();
|
||||
HighlightProperty->SetAmbientColor(1, 1, 1);
|
||||
HighlightProperty->SetDiffuseColor(1, 1, 1);
|
||||
HighlightProperty->SetSpecularColor(0.5, 0.5, 0.5);
|
||||
}
|
||||
|
||||
this->Property = HighlightProperty;
|
||||
|
||||
}
|
||||
else if (!highlight) {
|
||||
if(ishighlighted) {
|
||||
ishighlighted=false;
|
||||
if(myDisplayMode==1) {
|
||||
//unhilight in shading
|
||||
this->Property = ShadingProperty;
|
||||
}
|
||||
else {
|
||||
//unhilight in wireframe
|
||||
this->Property = WireframeProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool GEOM_Actor::hasHighlight()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void GEOM_Actor::SetHighlightProperty(vtkProperty* Prop) {
|
||||
this->HighlightProperty = Prop;
|
||||
}
|
||||
|
||||
|
||||
void GEOM_Actor::ReleaseGraphicsResources(vtkWindow *renWin)
|
||||
{
|
||||
vtkActor::ReleaseGraphicsResources(renWin);
|
||||
|
||||
// broadcast the message down to the individual LOD mappers
|
||||
|
||||
if(WireframeMapper) this->WireframeMapper->ReleaseGraphicsResources(renWin);
|
||||
if(ShadingMapper) this->ShadingMapper->ReleaseGraphicsResources(renWin);
|
||||
}
|
||||
|
||||
|
||||
// Copy the follower's composite 4x4 matrix into the matrix provided.
|
||||
void GEOM_Actor::GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result)
|
||||
{
|
||||
double *pos, *vup;
|
||||
double Rx[3], Ry[3], Rz[3], p1[3];
|
||||
vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
|
||||
int i;
|
||||
double distance;
|
||||
|
||||
this->GetOrientation();
|
||||
this->Transform->Push();
|
||||
this->Transform->PostMultiply();
|
||||
this->Transform->Identity();
|
||||
|
||||
// apply user defined matrix last if there is one
|
||||
if (this->UserMatrix)
|
||||
{
|
||||
this->Transform->Concatenate(this->UserMatrix);
|
||||
}
|
||||
|
||||
this->Transform->Translate(-this->Origin[0],
|
||||
-this->Origin[1],
|
||||
-this->Origin[2]);
|
||||
// scale
|
||||
this->Transform->Scale(this->Scale[0],
|
||||
this->Scale[1],
|
||||
this->Scale[2]);
|
||||
|
||||
// rotate
|
||||
this->Transform->RotateY(this->Orientation[1]);
|
||||
this->Transform->RotateX(this->Orientation[0]);
|
||||
this->Transform->RotateZ(this->Orientation[2]);
|
||||
|
||||
if (theCam)
|
||||
{
|
||||
// do the rotation
|
||||
// first rotate y
|
||||
pos = theCam->GetPosition();
|
||||
vup = theCam->GetViewUp();
|
||||
|
||||
if (theCam->GetParallelProjection())
|
||||
{
|
||||
theCam->GetDirectionOfProjection(Rz);
|
||||
}
|
||||
else
|
||||
{
|
||||
distance = sqrt(
|
||||
(pos[0] - this->Position[0])*(pos[0] - this->Position[0]) +
|
||||
(pos[1] - this->Position[1])*(pos[1] - this->Position[1]) +
|
||||
(pos[2] - this->Position[2])*(pos[2] - this->Position[2]));
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
Rz[i] = (pos[i] - this->Position[i])/distance;
|
||||
}
|
||||
}
|
||||
|
||||
vtkMath::Cross(vup,Rz,Rx);
|
||||
vtkMath::Normalize(Rx);
|
||||
vtkMath::Cross(Rz,Rx,Ry);
|
||||
|
||||
matrix->Element[0][0] = Rx[0];
|
||||
matrix->Element[1][0] = Rx[1];
|
||||
matrix->Element[2][0] = Rx[2];
|
||||
matrix->Element[0][1] = Ry[0];
|
||||
matrix->Element[1][1] = Ry[1];
|
||||
matrix->Element[2][1] = Ry[2];
|
||||
matrix->Element[0][2] = Rz[0];
|
||||
matrix->Element[1][2] = Rz[1];
|
||||
matrix->Element[2][2] = Rz[2];
|
||||
|
||||
this->Transform->Concatenate(matrix);
|
||||
}
|
||||
|
||||
// translate to projection reference point PRP
|
||||
// this is the camera's position blasted through
|
||||
// the current matrix
|
||||
p1[0] = this->Origin[0] + this->Position[0];
|
||||
p1[1] = this->Origin[1] + this->Position[1];
|
||||
p1[2] = this->Origin[2] + this->Position[2];
|
||||
|
||||
this->Transform->Translate(p1[0],p1[1],p1[2]);
|
||||
this->Transform->GetMatrix(result);
|
||||
|
||||
matrix->Delete();
|
||||
this->Transform->Pop();
|
||||
}
|
114
src/OBJECT/GEOM_Actor.h
Normal file
114
src/OBJECT/GEOM_Actor.h
Normal file
@ -0,0 +1,114 @@
|
||||
// File : GEOM_Actor.h
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Christophe ATTANASIO
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
|
||||
#ifndef GEOM_ACTOR_H
|
||||
#define GEOM_ACTOR_H
|
||||
|
||||
#include "SALOME_Actor.h"
|
||||
|
||||
//VTK
|
||||
#include <vtkMapper.h>
|
||||
#include <vtkProperty.h>
|
||||
#include <vtkMatrix4x4.h>
|
||||
#include <vtkCamera.h>
|
||||
|
||||
//OpenCASCADE
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
|
||||
class TopoDS_Shape;
|
||||
|
||||
#ifdef _WIN_32
|
||||
#define VTKOCC_EXPORT __declspec (dllexport)
|
||||
#else
|
||||
#define VTKOCC_EXPORT
|
||||
#endif
|
||||
class VTKOCC_EXPORT GEOM_Actor : public SALOME_Actor {
|
||||
|
||||
|
||||
public:
|
||||
vtkTypeMacro(GEOM_Actor,SALOME_Actor);
|
||||
|
||||
static GEOM_Actor* New();
|
||||
|
||||
// Description:
|
||||
// This causes the actor to be rendered. It, in turn, will render the actor's
|
||||
// property and then mapper.
|
||||
virtual void Render(vtkRenderer *, vtkMapper *);
|
||||
|
||||
// Description:
|
||||
// Release any graphics resources that are being consumed by this actor.
|
||||
// The parameter window could be used to determine which graphic
|
||||
// resources to release.
|
||||
void ReleaseGraphicsResources(vtkWindow *);
|
||||
|
||||
const TopoDS_Shape& getTopo();
|
||||
void setInputShape(const TopoDS_Shape& ashape,double adef1,int imode);
|
||||
|
||||
double getDeflection();
|
||||
void setDeflection(double adefl);
|
||||
|
||||
// SubShape
|
||||
void SubShapeOn();
|
||||
void SubShapeOff();
|
||||
|
||||
// Display Mode
|
||||
void setDisplayMode(int);
|
||||
|
||||
// Highlight
|
||||
void highlight(Standard_Boolean highlight);
|
||||
bool hasHighlight();
|
||||
|
||||
void ShallowCopy(vtkProp *prop);
|
||||
|
||||
// Properties
|
||||
void SetHighlightProperty(vtkProperty* Prop);
|
||||
void SetWireframeProperty(vtkProperty* Prop);
|
||||
void SetShadingProperty(vtkProperty* Prop);
|
||||
|
||||
// Opacity
|
||||
void SetOpacity(float opa);
|
||||
float GetOpacity();
|
||||
|
||||
// Color
|
||||
void SetColor(float r,float g,float b);
|
||||
void GetColor(float& r,float& g,float& b);
|
||||
|
||||
protected:
|
||||
|
||||
GEOM_Actor();
|
||||
~GEOM_Actor();
|
||||
GEOM_Actor(const GEOM_Actor&) {};
|
||||
void operator=(const GEOM_Actor&) {};
|
||||
|
||||
void CreateWireframeMapper();
|
||||
void CreateShadingMapper();
|
||||
void CreateMapper(int theMode);
|
||||
void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
bool subshape;
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
double deflection;
|
||||
|
||||
vtkMapper* ShadingMapper;
|
||||
vtkMapper* WireframeMapper;
|
||||
|
||||
vtkProperty* ShadingProperty;
|
||||
vtkProperty* WireframeProperty;
|
||||
vtkProperty* HighlightProperty;
|
||||
|
||||
int myDisplayMode;
|
||||
|
||||
};
|
||||
#endif //GEOM_ACTOR_H
|
388
src/OBJECT/GEOM_AssemblyBuilder.cxx
Normal file
388
src/OBJECT/GEOM_AssemblyBuilder.cxx
Normal file
@ -0,0 +1,388 @@
|
||||
using namespace std;
|
||||
// File : GEOM_AssemblyBuilder.cxx
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Christophe ATTANASIO
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
/*!
|
||||
\class GEOM_AssemblyBuilder GEOM_AssemblyBuilder.h
|
||||
\brief ....
|
||||
*/
|
||||
|
||||
#include "GEOM_AssemblyBuilder.h"
|
||||
#include "GEOM_Actor.h"
|
||||
#include "utilities.h"
|
||||
|
||||
// Open CASCADE Includes
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRepMesh_IncrementalMesh.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
|
||||
// SALOME
|
||||
|
||||
#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )
|
||||
#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void GEOM_AssemblyBuilder::InitProperties(vtkProperty* IsoProp,
|
||||
vtkProperty* FaceProp,
|
||||
vtkProperty* EdgeFProp,
|
||||
vtkProperty* EdgeSProp,
|
||||
vtkProperty* EdgeIProp,
|
||||
vtkProperty* VertexProp,
|
||||
vtkProperty* IsoPVProp,
|
||||
vtkProperty* EdgePVProp,
|
||||
vtkProperty* VertexPVProp)
|
||||
{
|
||||
// Shading like default OCC material
|
||||
FaceProp->SetRepresentationToSurface();
|
||||
FaceProp->SetInterpolation(1);
|
||||
FaceProp->SetAmbient(1.0);
|
||||
FaceProp->SetDiffuse(1.0);
|
||||
FaceProp->SetSpecular(0.4);
|
||||
FaceProp->SetAmbientColor(0.329412, 0.223529, 0.027451);
|
||||
FaceProp->SetDiffuseColor(0.780392, 0.568627, 0.113725);
|
||||
FaceProp->SetSpecularColor(0.992157, 0.941176, 0.807843);
|
||||
|
||||
// Wireframe for iso
|
||||
IsoProp->SetRepresentationToWireframe();
|
||||
IsoProp->SetAmbientColor(0.5, 0.5, 0.5);
|
||||
IsoProp->SetDiffuseColor(0.5, 0.5, 0.5);
|
||||
IsoProp->SetSpecularColor(0.5, 0.5, 0.5);
|
||||
|
||||
// Wireframe for iso
|
||||
IsoPVProp->SetRepresentationToWireframe();
|
||||
IsoPVProp->SetAmbientColor(0, 1, 1);
|
||||
IsoPVProp->SetDiffuseColor(0, 1, 1);
|
||||
IsoPVProp->SetSpecularColor(0, 1, 1);
|
||||
|
||||
// Wireframe for shared edge
|
||||
EdgeSProp->SetRepresentationToWireframe();
|
||||
EdgeSProp->SetAmbientColor(1, 1, 0);
|
||||
EdgeSProp->SetDiffuseColor(1, 1, 0);
|
||||
EdgeSProp->SetSpecularColor(1, 1, 0);
|
||||
|
||||
// Wireframe for free edge
|
||||
EdgeFProp->SetRepresentationToWireframe();
|
||||
EdgeFProp->SetAmbientColor(0, 1, 0);
|
||||
EdgeFProp->SetDiffuseColor(0, 1, 0);
|
||||
EdgeFProp->SetSpecularColor(0, 1, 0);
|
||||
|
||||
// Wireframe for isolated edge
|
||||
EdgeIProp->SetRepresentationToWireframe();
|
||||
EdgeIProp->SetAmbientColor(1, 0, 0);
|
||||
EdgeIProp->SetDiffuseColor(1, 0, 0);
|
||||
EdgeIProp->SetSpecularColor(1, 0, 0);
|
||||
|
||||
// Wireframe for Preview edge
|
||||
EdgePVProp->SetRepresentationToWireframe();
|
||||
EdgePVProp->SetAmbientColor(0, 1, 1);
|
||||
EdgePVProp->SetDiffuseColor(0, 1, 1);
|
||||
EdgePVProp->SetSpecularColor(0, 1, 1);
|
||||
|
||||
// Wireframe for vertex
|
||||
VertexProp->SetRepresentationToWireframe();
|
||||
VertexProp->SetAmbientColor(1, 1, 0);
|
||||
VertexProp->SetDiffuseColor(1, 1, 0);
|
||||
VertexProp->SetSpecularColor(1, 1, 0);
|
||||
|
||||
// Wireframe for vertex
|
||||
VertexPVProp->SetRepresentationToWireframe();
|
||||
VertexPVProp->SetAmbientColor(0, 1, 1);
|
||||
VertexPVProp->SetDiffuseColor(0, 1, 1);
|
||||
VertexPVProp->SetSpecularColor(0, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
void GEOM_AssemblyBuilder::MeshShape(const TopoDS_Shape myShape,
|
||||
Standard_Real deflection,
|
||||
Standard_Boolean forced)
|
||||
{
|
||||
// Mesh the shape if necessary
|
||||
Standard_Boolean alreadymesh = Standard_True;
|
||||
TopExp_Explorer ex;
|
||||
TopLoc_Location aLoc;
|
||||
|
||||
for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next()) {
|
||||
const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
|
||||
Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
|
||||
if(aPoly.IsNull()) { alreadymesh = Standard_False; break; }
|
||||
}
|
||||
|
||||
if(!alreadymesh || forced) {
|
||||
if(deflection<=0) {
|
||||
// Compute default deflection
|
||||
Bnd_Box B;
|
||||
BRepBndLib::Add(myShape, B);
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
deflection = MAX3( aXmax-aXmin , aYmax-aYmin , aZmax-aZmin) * 0.001 *4;
|
||||
}
|
||||
BRepMesh_IncrementalMesh MESH(myShape,deflection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShape,
|
||||
Standard_Real deflection,
|
||||
Standard_Integer mode,
|
||||
Standard_Boolean forced) {
|
||||
|
||||
vtkActorCollection* AISActors = vtkActorCollection::New();
|
||||
|
||||
// Create graphics properties
|
||||
|
||||
vtkProperty* IsoProp = vtkProperty::New();
|
||||
vtkProperty* FaceProp = vtkProperty::New();
|
||||
vtkProperty* EdgeFProp = vtkProperty::New();
|
||||
vtkProperty* EdgeSProp = vtkProperty::New();
|
||||
vtkProperty* EdgeIProp = vtkProperty::New();
|
||||
vtkProperty* VertexProp = vtkProperty::New();
|
||||
|
||||
vtkProperty* IsoPVProp = vtkProperty::New();
|
||||
vtkProperty* EdgePVProp = vtkProperty::New();
|
||||
vtkProperty* VertexPVProp = vtkProperty::New();
|
||||
|
||||
InitProperties(IsoProp,FaceProp,EdgeFProp,EdgeSProp,EdgeIProp,VertexProp,IsoPVProp,EdgePVProp,VertexPVProp);
|
||||
|
||||
MeshShape(myShape,deflection,forced);
|
||||
|
||||
if ( myShape.ShapeType() <= 4 ) {
|
||||
|
||||
// FACE Actor
|
||||
// look if edges are free or shared
|
||||
TopTools_IndexedDataMapOfShapeListOfShape edgemap;
|
||||
TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,edgemap);
|
||||
|
||||
TopExp_Explorer ex;
|
||||
|
||||
for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next()) {
|
||||
|
||||
GEOM_Actor* FaceActor = GEOM_Actor::New();
|
||||
FaceActor->SetShadingProperty(FaceProp);
|
||||
FaceActor->SetWireframeProperty(IsoProp);
|
||||
|
||||
FaceActor->SetPreviewProperty(IsoPVProp);
|
||||
|
||||
FaceActor->setInputShape(ex.Current(),deflection,mode);
|
||||
|
||||
AISActors->AddItem(FaceActor);
|
||||
|
||||
TopExp_Explorer ex2;
|
||||
for (ex2.Init(ex.Current(), TopAbs_EDGE); ex2.More(); ex2.Next()) {
|
||||
const TopoDS_Edge& aEdge = TopoDS::Edge(ex2.Current());
|
||||
|
||||
if (BRep_Tool::Degenerated(aEdge)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// compute the number of faces
|
||||
Standard_Integer nbf = edgemap.FindFromKey(ex2.Current()).Extent();
|
||||
GEOM_Actor* EdgeActor = GEOM_Actor::New();
|
||||
EdgeActor->SubShapeOn();
|
||||
EdgeActor->setInputShape(ex2.Current(),deflection,mode);
|
||||
switch (nbf) {
|
||||
|
||||
case 0 : // isolated edge
|
||||
{
|
||||
EdgeActor->SetShadingProperty(EdgeIProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeIProp);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1 :// edge in only one face
|
||||
{
|
||||
EdgeActor->SetShadingProperty(EdgeFProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeFProp);
|
||||
}
|
||||
break;
|
||||
|
||||
default : // edge shared by at least two faces
|
||||
{
|
||||
EdgeActor->SetShadingProperty(EdgeSProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeSProp);
|
||||
}
|
||||
}
|
||||
EdgeActor->SetPreviewProperty(EdgePVProp);
|
||||
AISActors->AddItem(EdgeActor);
|
||||
}
|
||||
}
|
||||
} else if ( myShape.ShapeType() == TopAbs_WIRE ) { // WIRE Actor
|
||||
TopExp_Explorer ex;
|
||||
for (ex.Init(myShape, TopAbs_EDGE); ex.More(); ex.Next()) {
|
||||
const TopoDS_Edge& aEdge = TopoDS::Edge(ex.Current());
|
||||
|
||||
if (BRep_Tool::Degenerated(aEdge)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GEOM_Actor* EdgeActor = GEOM_Actor::New();
|
||||
EdgeActor->setInputShape(ex.Current(),deflection,mode);
|
||||
EdgeActor->SetShadingProperty(EdgeIProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeIProp);
|
||||
EdgeActor->SetPreviewProperty(EdgePVProp);
|
||||
|
||||
AISActors->AddItem(EdgeActor);
|
||||
}
|
||||
} else if ( myShape.ShapeType() == TopAbs_EDGE ) { // EDGE Actor
|
||||
GEOM_Actor* EdgeActor = GEOM_Actor::New();
|
||||
EdgeActor->setInputShape(myShape,deflection,mode);
|
||||
EdgeActor->SetShadingProperty(EdgeIProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeIProp);
|
||||
EdgeActor->SetPreviewProperty(EdgePVProp);
|
||||
|
||||
AISActors->AddItem(EdgeActor);
|
||||
} else if ( myShape.ShapeType() == TopAbs_VERTEX ) { // VERTEX Actor
|
||||
GEOM_Actor* VertexActor = GEOM_Actor::New();
|
||||
VertexActor->setInputShape(myShape,deflection,mode);
|
||||
VertexActor->SetShadingProperty(VertexProp);
|
||||
VertexActor->SetWireframeProperty(VertexProp);
|
||||
VertexActor->SetPreviewProperty(VertexPVProp);
|
||||
|
||||
AISActors->AddItem(VertexActor);
|
||||
|
||||
}
|
||||
|
||||
return AISActors;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// BUILD ASSEMBLY
|
||||
//-------------------------------------------------------------
|
||||
vtkAssembly* GEOM_AssemblyBuilder::BuildAssembly(const TopoDS_Shape& myShape,
|
||||
Standard_Real deflection,
|
||||
Standard_Integer mode,
|
||||
Standard_Boolean forced)
|
||||
{
|
||||
// Create a new vtkAssembly
|
||||
|
||||
vtkAssembly* myVTKShape = vtkAssembly::New();
|
||||
|
||||
|
||||
// Create graphics properties
|
||||
|
||||
vtkProperty* IsoProp = vtkProperty::New();
|
||||
vtkProperty* FaceProp = vtkProperty::New();
|
||||
vtkProperty* EdgeFProp = vtkProperty::New();
|
||||
vtkProperty* EdgeSProp = vtkProperty::New();
|
||||
vtkProperty* EdgeIProp = vtkProperty::New();
|
||||
vtkProperty* VertexProp = vtkProperty::New();
|
||||
vtkProperty* EdgePVProp = vtkProperty::New();
|
||||
vtkProperty* VertexPVProp = vtkProperty::New();
|
||||
vtkProperty* IsoPVProp = vtkProperty::New();
|
||||
|
||||
InitProperties(IsoProp,FaceProp,EdgeFProp,EdgeSProp,EdgeIProp,VertexProp,IsoPVProp,EdgePVProp,VertexPVProp);
|
||||
|
||||
MeshShape(myShape,deflection,forced);
|
||||
|
||||
|
||||
// FACE Actor
|
||||
|
||||
// look if edges are free or shared
|
||||
TopTools_IndexedDataMapOfShapeListOfShape edgemap;
|
||||
TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,edgemap);
|
||||
|
||||
TopExp_Explorer ex;
|
||||
|
||||
for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next()) {
|
||||
//const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
|
||||
|
||||
GEOM_Actor* FaceActor = GEOM_Actor::New();
|
||||
FaceActor->SetShadingProperty(FaceProp);
|
||||
FaceActor->SetWireframeProperty(IsoProp);
|
||||
|
||||
vtkAssembly* myFaceAssembly = vtkAssembly::New();
|
||||
|
||||
|
||||
FaceActor->setInputShape(ex.Current(),deflection,mode);
|
||||
myFaceAssembly->AddPart(FaceActor);
|
||||
|
||||
TopExp_Explorer ex2;
|
||||
for (ex2.Init(ex.Current(), TopAbs_EDGE); ex2.More(); ex2.Next()) {
|
||||
const TopoDS_Edge& aEdge = TopoDS::Edge(ex2.Current());
|
||||
|
||||
if (BRep_Tool::Degenerated(aEdge)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// compute the number of faces
|
||||
Standard_Integer nbf = edgemap.FindFromKey(ex2.Current()).Extent();
|
||||
GEOM_Actor* EdgeActor = GEOM_Actor::New();
|
||||
switch (nbf) {
|
||||
|
||||
case 0 : // isolated edge
|
||||
{
|
||||
EdgeActor->SetShadingProperty(EdgeIProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeIProp);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1 :// edge in only one face
|
||||
{
|
||||
EdgeActor->SetShadingProperty(EdgeFProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeFProp);
|
||||
}
|
||||
break;
|
||||
|
||||
default : // edge shared by at least two faces
|
||||
{
|
||||
EdgeActor->SetShadingProperty(EdgeSProp);
|
||||
EdgeActor->SetWireframeProperty(EdgeSProp);
|
||||
}
|
||||
}
|
||||
|
||||
EdgeActor->setInputShape(ex2.Current(),deflection,mode);
|
||||
myFaceAssembly->AddPart(EdgeActor);
|
||||
}
|
||||
myVTKShape->AddPart(myFaceAssembly);
|
||||
}
|
||||
|
||||
return myVTKShape;
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// CHANGE SPECIFIC DISPLAY MODE
|
||||
//-------------------------------------------------------------
|
||||
void GEOM_AssemblyBuilder::SwitchDisplayMode(vtkAssembly* aOCCAssembly)
|
||||
{
|
||||
}
|
||||
|
||||
void GEOM_AssemblyBuilder::SwitchDisplayMode(vtkActorCollection* aOCCAssembly)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// DISPLAY/ERASE
|
||||
//-------------------------------------------------------------
|
||||
|
||||
void GEOM_AssemblyBuilder::DisplayErase(vtkAssembly* mySALOMEAssembly)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GEOM_AssemblyBuilder::DisplayErase(vtkActorCollection* mySALOMEActors)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
74
src/OBJECT/GEOM_AssemblyBuilder.h
Normal file
74
src/OBJECT/GEOM_AssemblyBuilder.h
Normal file
@ -0,0 +1,74 @@
|
||||
// File : GEOM_AssemblyBuilder.h
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Christophe ATTANASIO
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
// VTK
|
||||
#include <vtkAssembly.h>
|
||||
#include <vtkPropAssembly.h>
|
||||
#include <vtkActorCollection.h>
|
||||
|
||||
// Open CASCADE Inlcudes
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
class GEOM_AssemblyBuilder {
|
||||
|
||||
private:
|
||||
|
||||
static void InitProperties(vtkProperty* IsoProp,
|
||||
vtkProperty* FaceProp,
|
||||
vtkProperty* EdgeFProp,
|
||||
vtkProperty* EdgeSProp,
|
||||
vtkProperty* EdgeIProp,
|
||||
vtkProperty* VertexProp,
|
||||
vtkProperty* IsoPVProp,
|
||||
vtkProperty* EdgePVProp,
|
||||
vtkProperty* VertePVProp);
|
||||
|
||||
static void MeshShape(const TopoDS_Shape myShape,
|
||||
Standard_Real deflection,
|
||||
Standard_Boolean forced);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// WARNING! Poor graphic performance :-( use BuildActors instead
|
||||
//------------------------------------------------------------------
|
||||
|
||||
static vtkAssembly* BuildAssembly(const TopoDS_Shape& myShape,
|
||||
Standard_Real deflection,
|
||||
Standard_Integer amode,
|
||||
Standard_Boolean forced);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Good performance
|
||||
//------------------------------------------------------------------
|
||||
|
||||
static vtkActorCollection* BuildActors(const TopoDS_Shape& myShape,
|
||||
Standard_Real deflection,
|
||||
Standard_Integer amode,
|
||||
Standard_Boolean forced);
|
||||
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Change mode - Not implemented !!
|
||||
//------------------------------------------------------------------
|
||||
|
||||
static void SwitchDisplayMode(vtkAssembly* mySALOMEAssembly);
|
||||
static void SwitchDisplayMode(vtkActorCollection* mySALOMEActors);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Erase/Display - Not implemented !!
|
||||
//------------------------------------------------------------------
|
||||
|
||||
static void DisplayErase(vtkAssembly* mySALOMEAssembly);
|
||||
static void DisplayErase(vtkActorCollection* mySALOMEActors);
|
||||
|
||||
|
||||
};
|
56
src/OBJECT/GEOM_InteractiveObject.cxx
Normal file
56
src/OBJECT/GEOM_InteractiveObject.cxx
Normal file
@ -0,0 +1,56 @@
|
||||
using namespace std;
|
||||
// File : GEOM_InteractiveObject.cxx
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Christophe ATTANASIO
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
/*!
|
||||
\class GEOM_InteractiveObject GEOM_InteractiveObject.hxx
|
||||
\brief ....
|
||||
*/
|
||||
|
||||
#include "GEOM_InteractiveObject.ixx"
|
||||
|
||||
GEOM_InteractiveObject::GEOM_InteractiveObject()
|
||||
: SALOME_InteractiveObject()
|
||||
{
|
||||
myIOR = "";
|
||||
myFatherIOR = "";
|
||||
}
|
||||
|
||||
GEOM_InteractiveObject::GEOM_InteractiveObject(const Standard_CString anIOR,
|
||||
const Standard_CString aFatherIOR,
|
||||
const Standard_CString aComponentDataType,
|
||||
const Standard_CString anEntry)
|
||||
: SALOME_InteractiveObject(anEntry,aComponentDataType)
|
||||
{
|
||||
myIOR = new char [strlen(anIOR)+1];
|
||||
strcpy( myIOR, anIOR);
|
||||
myFatherIOR = new char [strlen(aFatherIOR)+1];
|
||||
strcpy( myFatherIOR, aFatherIOR);
|
||||
}
|
||||
|
||||
Standard_CString GEOM_InteractiveObject::getIOR(){
|
||||
return myIOR;
|
||||
}
|
||||
Standard_CString GEOM_InteractiveObject::getFatherIOR(){
|
||||
return myFatherIOR;
|
||||
}
|
||||
|
||||
Standard_Boolean GEOM_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
|
||||
if ( anIO->hasEntry() && this->hasEntry() ) {
|
||||
if ( strcmp(myEntry, anIO->getEntry() ) == 0 )
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
if ( anIO->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) {
|
||||
Handle(GEOM_InteractiveObject) theIO = Handle(GEOM_InteractiveObject)::DownCast( anIO );
|
||||
if ( strcmp(myIOR, theIO->getIOR() ) == 0 )
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
116
src/OBJECT/GEOM_InteractiveObject.hxx
Normal file
116
src/OBJECT/GEOM_InteractiveObject.hxx
Normal file
@ -0,0 +1,116 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#ifndef _GEOM_InteractiveObject_HeaderFile
|
||||
#define _GEOM_InteractiveObject_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOM_InteractiveObject_HeaderFile
|
||||
#include "Handle_GEOM_InteractiveObject.hxx"
|
||||
#endif
|
||||
|
||||
#ifndef _Standard_CString_HeaderFile
|
||||
#include <Standard_CString.hxx>
|
||||
#endif
|
||||
#ifndef _SALOME_InteractiveObject_HeaderFile
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
|
||||
#include "Handle_SALOME_InteractiveObject.hxx"
|
||||
#endif
|
||||
class SALOME_InteractiveObject;
|
||||
|
||||
|
||||
class GEOM_InteractiveObject : public SALOME_InteractiveObject {
|
||||
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT GEOM_InteractiveObject();
|
||||
Standard_EXPORT GEOM_InteractiveObject(const Standard_CString anIOR,
|
||||
const Standard_CString aFatherIOR,
|
||||
const Standard_CString aComponentDataType,
|
||||
const Standard_CString anEntry = "");
|
||||
Standard_EXPORT void setIOR(const Standard_CString anEntry) ;
|
||||
Standard_EXPORT Standard_CString getIOR() ;
|
||||
Standard_EXPORT void setFatherIOR(const Standard_CString anEntry) ;
|
||||
Standard_EXPORT Standard_CString getFatherIOR() ;
|
||||
Standard_EXPORT virtual Standard_Boolean isSame(const Handle(SALOME_InteractiveObject)& anIO) ;
|
||||
Standard_EXPORT ~GEOM_InteractiveObject();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& GEOM_InteractiveObject_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_CString myIOR;
|
||||
Standard_CString myFatherIOR;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
71
src/OBJECT/GEOM_InteractiveObject.ixx
Normal file
71
src/OBJECT/GEOM_InteractiveObject.ixx
Normal file
@ -0,0 +1,71 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include "GEOM_InteractiveObject.jxx"
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
GEOM_InteractiveObject::~GEOM_InteractiveObject() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOM_InteractiveObject_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_InteractiveObject);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_InteractiveObject);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOM_InteractiveObject",
|
||||
sizeof(GEOM_InteractiveObject),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOM_InteractiveObject) Handle(GEOM_InteractiveObject)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOM_InteractiveObject) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) {
|
||||
_anOtherObject = Handle(GEOM_InteractiveObject)((Handle(GEOM_InteractiveObject)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOM_InteractiveObject::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOM_InteractiveObject) ;
|
||||
}
|
||||
Standard_Boolean GEOM_InteractiveObject::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(GEOM_InteractiveObject) == AType || SALOME_InteractiveObject::IsKind(AType));
|
||||
}
|
||||
Handle_GEOM_InteractiveObject::~Handle_GEOM_InteractiveObject() {}
|
||||
|
6
src/OBJECT/GEOM_InteractiveObject.jxx
Normal file
6
src/OBJECT/GEOM_InteractiveObject.jxx
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _SALOME_InteractiveObject_HeaderFile
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
#endif
|
||||
#ifndef _GEOM_InteractiveObject_HeaderFile
|
||||
#include "GEOM_InteractiveObject.hxx"
|
||||
#endif
|
968
src/OBJECT/GEOM_OCCReader.cxx
Normal file
968
src/OBJECT/GEOM_OCCReader.cxx
Normal file
@ -0,0 +1,968 @@
|
||||
using namespace std;
|
||||
// File : GEOM_OCCReader.h
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Christophe ATTANASIO
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
#include "GEOM_OCCReader.h"
|
||||
|
||||
// SALOME Includes
|
||||
#include "utilities.h"
|
||||
|
||||
// VTK Includes
|
||||
#include <vtkObjectFactory.h>
|
||||
#include <vtkMergePoints.h>
|
||||
|
||||
// OpenCASCADE Includes
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <BRepMesh_IncrementalMesh.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Poly_Polygon3D.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dHatch_Intersector.hxx>
|
||||
#include <Geom2dHatch_Hatcher.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <HatchGen_Domain.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
|
||||
|
||||
#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )
|
||||
#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) )
|
||||
|
||||
// Constante for iso building
|
||||
static Standard_Real IntersectorConfusion = 1.e-10 ; // -8 ;
|
||||
static Standard_Real IntersectorTangency = 1.e-10 ; // -8 ;
|
||||
static Standard_Real HatcherConfusion2d = 1.e-8 ;
|
||||
static Standard_Real HatcherConfusion3d = 1.e-8 ;
|
||||
|
||||
static Standard_Integer lastVTKpoint = 0;
|
||||
static Standard_Integer PlotCount = 0;
|
||||
static Standard_Real IsoRatio = 1.001;
|
||||
static Standard_Integer MaxPlotCount = 5;
|
||||
|
||||
//=======================================================================
|
||||
// Function : New
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
|
||||
GEOM_OCCReader* GEOM_OCCReader::New()
|
||||
{
|
||||
vtkObject* ret = vtkObjectFactory::CreateInstance("GEOM_OCCReader");
|
||||
if(ret) {
|
||||
return (GEOM_OCCReader*)ret;
|
||||
}
|
||||
return new GEOM_OCCReader;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : GEOM_OCCReader
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
|
||||
GEOM_OCCReader::GEOM_OCCReader()
|
||||
{
|
||||
//this->myShape = NULL;
|
||||
this->amode = 0;
|
||||
this->forced = Standard_False;
|
||||
this->discretiso = 15;
|
||||
this->nbisos = 1;
|
||||
}
|
||||
//=======================================================================
|
||||
// Function : ~GEOM_OCCReader
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
|
||||
GEOM_OCCReader::~GEOM_OCCReader()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// Function : Execute
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
void GEOM_OCCReader::Execute() {
|
||||
|
||||
vtkPolyData* output = this->GetOutput();
|
||||
vtkPoints* Pts = NULL;
|
||||
vtkCellArray* Cells = NULL;
|
||||
TopLoc_Location aLoc;
|
||||
|
||||
// Allocation
|
||||
Pts = vtkPoints::New();
|
||||
Cells = vtkCellArray::New();
|
||||
|
||||
//Compute number of triangles and points
|
||||
Standard_Integer nbpoly=0,nbpts=0;
|
||||
|
||||
if(amode==1) {
|
||||
//for shading
|
||||
|
||||
if(myShape.ShapeType() == TopAbs_FACE) {
|
||||
// whole FACE
|
||||
const TopoDS_Face& aFace = TopoDS::Face(myShape);
|
||||
Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
|
||||
if(aPoly.IsNull()) {
|
||||
Pts->Delete();
|
||||
Cells->Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
nbpts = aPoly->NbNodes();
|
||||
nbpoly = aPoly->NbTriangles();
|
||||
|
||||
Pts->SetNumberOfPoints(nbpts);
|
||||
Cells->Allocate(Cells->EstimateSize(nbpoly,3));
|
||||
}
|
||||
else {
|
||||
Cells->Delete();
|
||||
Pts->Delete();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Start computation
|
||||
if(amode == 0) {
|
||||
ComputeWireframe(Pts,Cells);
|
||||
output->SetPoints(Pts);
|
||||
output->SetLines(Cells);
|
||||
output->Squeeze();
|
||||
}
|
||||
else {
|
||||
if(myShape.ShapeType() == TopAbs_FACE) {
|
||||
ComputeShading(Pts,Cells);
|
||||
|
||||
output->SetPoints(Pts);
|
||||
output->SetPolys(Cells);
|
||||
output->Squeeze();
|
||||
}
|
||||
}
|
||||
Pts->Delete();
|
||||
Cells->Delete();
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ComputeWireframe
|
||||
// Purpose : Compute the shape in CAD wireframe mode
|
||||
//=======================================================================
|
||||
|
||||
void GEOM_OCCReader::ComputeWireframe(vtkPoints* Pts,vtkCellArray* Cells){
|
||||
|
||||
// Check the type of the shape:
|
||||
if(myShape.ShapeType() == TopAbs_FACE) {
|
||||
// Face
|
||||
TransferFaceWData(TopoDS::Face(myShape),Pts,Cells);
|
||||
} else if(myShape.ShapeType() == TopAbs_EDGE) {
|
||||
// Edge
|
||||
TransferEdgeWData(TopoDS::Edge(myShape),Pts,Cells);
|
||||
} else {
|
||||
if(myShape.ShapeType() == TopAbs_VERTEX) {
|
||||
// Vertex
|
||||
TransferVertexWData(TopoDS::Vertex(myShape),Pts,Cells);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TransferFaceWData
|
||||
// Purpose : Transfert wireframe data for FACE
|
||||
//=======================================================================
|
||||
|
||||
void GEOM_OCCReader::TransferFaceWData(const TopoDS_Face& aFace,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells)
|
||||
{
|
||||
TopoDS_Face aCopyFace = aFace;
|
||||
aCopyFace.Orientation (TopAbs_FORWARD);
|
||||
createISO(aCopyFace,Precision::Infinite(),1,Pts,Cells);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : createISO
|
||||
// Purpose : Create ISO for Face Wireframe representation
|
||||
//=======================================================================
|
||||
|
||||
void GEOM_OCCReader::createISO (const TopoDS_Face& TopologicalFace,
|
||||
const Standard_Real Infinite,
|
||||
const Standard_Integer NbIsos,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cell)
|
||||
{
|
||||
Geom2dHatch_Hatcher aHatcher (Geom2dHatch_Intersector (IntersectorConfusion,
|
||||
IntersectorTangency),
|
||||
HatcherConfusion2d,
|
||||
HatcherConfusion3d,
|
||||
Standard_True,
|
||||
Standard_False);
|
||||
|
||||
Standard_Real myInfinite,myUMin,myUMax,myVMin,myVMax;
|
||||
//myInfinite = Precision::Infinite();
|
||||
myInfinite = 1e38; // VTK uses float numbers - Precision::Infinite() is double and can not be accepted.
|
||||
|
||||
Standard_Integer myNbDom;
|
||||
TColStd_Array1OfReal myUPrm(1, NbIsos),myVPrm(1, NbIsos);
|
||||
TColStd_Array1OfInteger myUInd(1, NbIsos),myVInd(1, NbIsos);
|
||||
|
||||
myUInd.Init(0);
|
||||
myVInd.Init(0);
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// If the Min Max bounds are infinite, there are bounded to Infinite
|
||||
// value.
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
BRepTools::UVBounds (TopologicalFace, myUMin, myUMax, myVMin, myVMax) ;
|
||||
Standard_Boolean InfiniteUMin = Precision::IsNegativeInfinite (myUMin) ;
|
||||
Standard_Boolean InfiniteUMax = Precision::IsPositiveInfinite (myUMax) ;
|
||||
Standard_Boolean InfiniteVMin = Precision::IsNegativeInfinite (myVMin) ;
|
||||
Standard_Boolean InfiniteVMax = Precision::IsPositiveInfinite (myVMax) ;
|
||||
if (InfiniteUMin && InfiniteUMax) {
|
||||
myUMin = - myInfinite ;
|
||||
myUMax = myInfinite ;
|
||||
} else if (InfiniteUMin) {
|
||||
myUMin = myUMax - myInfinite ;
|
||||
} else if (InfiniteUMax) {
|
||||
myUMax = myUMin + myInfinite ;
|
||||
}
|
||||
if (InfiniteVMin && InfiniteVMax) {
|
||||
myVMin = - myInfinite ;
|
||||
myVMax = myInfinite ;
|
||||
} else if (InfiniteVMin) {
|
||||
myVMin = myVMax - myInfinite ;
|
||||
} else if (InfiniteVMax) {
|
||||
myVMax = myVMin + myInfinite ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Retreiving the edges and loading them into the hatcher.
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TopExp_Explorer ExpEdges ;
|
||||
for (ExpEdges.Init (TopologicalFace, TopAbs_EDGE) ; ExpEdges.More() ; ExpEdges.Next()) {
|
||||
const TopoDS_Edge& TopologicalEdge = TopoDS::Edge (ExpEdges.Current()) ;
|
||||
Standard_Real U1, U2 ;
|
||||
const Handle(Geom2d_Curve) PCurve = BRep_Tool::CurveOnSurface (TopologicalEdge, TopologicalFace, U1, U2) ;
|
||||
|
||||
if ( PCurve.IsNull() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( U1==U2) {
|
||||
return;
|
||||
}
|
||||
|
||||
//-- Test if a TrimmedCurve is necessary
|
||||
if( Abs(PCurve->FirstParameter()-U1)<= Precision::PConfusion()
|
||||
&& Abs(PCurve->LastParameter()-U2)<= Precision::PConfusion()) {
|
||||
aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ;
|
||||
}
|
||||
else {
|
||||
if (!PCurve->IsPeriodic()) {
|
||||
Handle (Geom2d_TrimmedCurve) TrimPCurve =Handle(Geom2d_TrimmedCurve)::DownCast(PCurve);
|
||||
if (!TrimPCurve.IsNull()) {
|
||||
if (TrimPCurve->BasisCurve()->FirstParameter()-U1 > Precision::PConfusion() ||
|
||||
U2-TrimPCurve->BasisCurve()->LastParameter() > Precision::PConfusion()) {
|
||||
aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (PCurve->FirstParameter()-U1 > Precision::PConfusion()){
|
||||
U1=PCurve->FirstParameter();
|
||||
}
|
||||
if (U2-PCurve->LastParameter() > Precision::PConfusion()){
|
||||
U2=PCurve->LastParameter();
|
||||
}
|
||||
}
|
||||
}
|
||||
Handle (Geom2d_TrimmedCurve) TrimPCurve = new Geom2d_TrimmedCurve (PCurve, U1, U2) ;
|
||||
aHatcher.AddElement (TrimPCurve, TopologicalEdge.Orientation()) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Loading and trimming the hatchings.
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
Standard_Integer IIso ;
|
||||
Standard_Real DeltaU = Abs (myUMax - myUMin) ;
|
||||
Standard_Real DeltaV = Abs (myVMax - myVMin) ;
|
||||
Standard_Real confusion = Min (DeltaU, DeltaV) * HatcherConfusion3d ;
|
||||
aHatcher.Confusion3d (confusion) ;
|
||||
|
||||
Standard_Real StepU = DeltaU / (Standard_Real) NbIsos ;
|
||||
if (StepU > confusion) {
|
||||
Standard_Real UPrm = myUMin + StepU / 2. ;
|
||||
gp_Dir2d Dir (0., 1.) ;
|
||||
for (IIso = 1 ; IIso <= NbIsos ; IIso++) {
|
||||
myUPrm(IIso) = UPrm ;
|
||||
gp_Pnt2d Ori (UPrm, 0.) ;
|
||||
Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ;
|
||||
myUInd(IIso) = aHatcher.AddHatching (HCur) ;
|
||||
UPrm += StepU ;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real StepV = DeltaV / (Standard_Real) NbIsos ;
|
||||
if (StepV > confusion) {
|
||||
Standard_Real VPrm = myVMin + StepV / 2. ;
|
||||
gp_Dir2d Dir (1., 0.) ;
|
||||
for (IIso = 1 ; IIso <= NbIsos ; IIso++) {
|
||||
myVPrm(IIso) = VPrm ;
|
||||
gp_Pnt2d Ori (0., VPrm) ;
|
||||
Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ;
|
||||
myVInd(IIso) = aHatcher.AddHatching (HCur) ;
|
||||
VPrm += StepV ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Computation.
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
aHatcher.Trim() ;
|
||||
|
||||
myNbDom = 0 ;
|
||||
for (IIso = 1 ; IIso <= NbIsos ; IIso++) {
|
||||
Standard_Integer Index ;
|
||||
|
||||
Index = myUInd(IIso) ;
|
||||
if (Index != 0) {
|
||||
if (aHatcher.TrimDone (Index) && !aHatcher.TrimFailed (Index)) {
|
||||
aHatcher.ComputeDomains (Index);
|
||||
if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ;
|
||||
}
|
||||
}
|
||||
|
||||
Index = myVInd(IIso) ;
|
||||
if (Index != 0) {
|
||||
if (aHatcher.TrimDone (Index) && !aHatcher.TrimFailed (Index)) {
|
||||
aHatcher.ComputeDomains (Index);
|
||||
if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Push iso lines in vtk kernel
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
Standard_Integer pt_start_idx = 0;
|
||||
|
||||
for (Standard_Integer UIso = myUPrm.Lower() ; UIso <= myUPrm.Upper() ; UIso++) {
|
||||
Standard_Integer UInd = myUInd.Value (UIso) ;
|
||||
if (UInd != 0) {
|
||||
Standard_Real UPrm = myUPrm.Value (UIso) ;
|
||||
if (!aHatcher.IsDone (UInd)) {
|
||||
MESSAGE("DBRep_IsoBuilder:: U iso of parameter: "<<UPrm)
|
||||
switch (aHatcher.Status (UInd)) {
|
||||
case HatchGen_NoProblem : MESSAGE("No Problem") ; break ;
|
||||
case HatchGen_TrimFailure : MESSAGE("Trim Failure") ; break ;
|
||||
case HatchGen_TransitionFailure : MESSAGE("Transition Failure") ; break ;
|
||||
case HatchGen_IncoherentParity : MESSAGE("Incoherent Parity") ; break ;
|
||||
case HatchGen_IncompatibleStates : MESSAGE("Incompatible States") ; break ;
|
||||
}
|
||||
} else {
|
||||
Standard_Integer NbDom = aHatcher.NbDomains (UInd) ;
|
||||
for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++) {
|
||||
const HatchGen_Domain& Dom = aHatcher.Domain (UInd, IDom) ;
|
||||
Standard_Real V1 = Dom.HasFirstPoint() ? Dom.FirstPoint().Parameter() : myVMin - myInfinite ;
|
||||
Standard_Real V2 = Dom.HasSecondPoint() ? Dom.SecondPoint().Parameter() : myVMax + myInfinite ;
|
||||
DrawIso(GeomAbs_IsoU, UPrm, V1, V2, Pts, Cell,pt_start_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Standard_Integer VIso = myVPrm.Lower() ; VIso <= myVPrm.Upper() ; VIso++) {
|
||||
Standard_Integer VInd = myVInd.Value (VIso) ;
|
||||
if (VInd != 0) {
|
||||
Standard_Real VPrm = myVPrm.Value (VIso) ;
|
||||
if (!aHatcher.IsDone (VInd)) {
|
||||
MESSAGE("DBRep_IsoBuilder:: V iso of parameter: "<<VPrm)
|
||||
switch (aHatcher.Status (VInd)) {
|
||||
case HatchGen_NoProblem : MESSAGE("No Problem") ; break ;
|
||||
case HatchGen_TrimFailure : MESSAGE("Trim Failure") ; break ;
|
||||
case HatchGen_TransitionFailure : MESSAGE("Transition Failure") ; break ;
|
||||
case HatchGen_IncoherentParity : MESSAGE("Incoherent Parity") ; break ;
|
||||
case HatchGen_IncompatibleStates : MESSAGE("Incompatible States") ; break ;
|
||||
}
|
||||
} else {
|
||||
Standard_Integer NbDom = aHatcher.NbDomains (VInd) ;
|
||||
for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++) {
|
||||
const HatchGen_Domain& Dom = aHatcher.Domain (VInd, IDom) ;
|
||||
Standard_Real U1 = Dom.HasFirstPoint() ? Dom.FirstPoint().Parameter() : myVMin - myInfinite ;
|
||||
Standard_Real U2 = Dom.HasSecondPoint() ? Dom.SecondPoint().Parameter() : myVMax + myInfinite ;
|
||||
DrawIso(GeomAbs_IsoV, VPrm, U1, U2, Pts, Cell,pt_start_idx) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : MoveTo
|
||||
// Purpose : Init VTK ISO PLOT
|
||||
//=======================================================================
|
||||
void GEOM_OCCReader::MoveTo(gp_Pnt P,
|
||||
vtkPoints* Pts)
|
||||
{
|
||||
float coord[3];
|
||||
|
||||
coord[0] = P.X(); coord[1] = P.Y(); coord[2] = P.Z();
|
||||
lastVTKpoint = Pts->InsertNextPoint(coord);
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : DrawTo
|
||||
// Purpose : Plot point in VTK
|
||||
//=======================================================================
|
||||
void GEOM_OCCReader::DrawTo(gp_Pnt P,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells)
|
||||
{
|
||||
float coord[3];
|
||||
coord[0] = P.X(); coord[1] = P.Y(); coord[2] = P.Z();
|
||||
Standard_Integer NewVTKpoint = Pts->InsertNextPoint(coord);
|
||||
|
||||
int pts[2];
|
||||
pts[0] = lastVTKpoint;
|
||||
pts[1] = NewVTKpoint;
|
||||
|
||||
Cells->InsertNextCell(2,pts);
|
||||
|
||||
lastVTKpoint = NewVTKpoint;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// Function : DrawIso
|
||||
// Purpose : Draw an iso on vtk
|
||||
//=======================================================================
|
||||
void GEOM_OCCReader::DrawIso(GeomAbs_IsoType T,
|
||||
Standard_Real Par,
|
||||
Standard_Real T1,
|
||||
Standard_Real T2,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells,
|
||||
Standard_Integer& startidx)
|
||||
{
|
||||
|
||||
Standard_Boolean halt = Standard_False;
|
||||
Standard_Integer j,myDiscret = discretiso;
|
||||
Standard_Real U1,U2,V1,V2,stepU=0.,stepV=0.;
|
||||
gp_Pnt P;
|
||||
TopLoc_Location l;
|
||||
|
||||
const Handle(Geom_Surface)& S = BRep_Tool::Surface(TopoDS::Face(myShape),l);
|
||||
if (!S.IsNull()) {
|
||||
BRepAdaptor_Surface S(TopoDS::Face(myShape),Standard_False);
|
||||
|
||||
GeomAbs_SurfaceType SurfType = S.GetType();
|
||||
|
||||
GeomAbs_CurveType CurvType = GeomAbs_OtherCurve;
|
||||
|
||||
Standard_Integer Intrv, nbIntv;
|
||||
Standard_Integer nbUIntv = S.NbUIntervals(GeomAbs_CN);
|
||||
Standard_Integer nbVIntv = S.NbVIntervals(GeomAbs_CN);
|
||||
TColStd_Array1OfReal TI(1,Max(nbUIntv, nbVIntv)+1);
|
||||
|
||||
|
||||
if (T == GeomAbs_IsoU) {
|
||||
S.VIntervals(TI, GeomAbs_CN);
|
||||
V1 = Max(T1, TI(1));
|
||||
V2 = Min(T2, TI(2));
|
||||
U1 = Par;
|
||||
U2 = Par;
|
||||
stepU = 0;
|
||||
nbIntv = nbVIntv;
|
||||
}
|
||||
else {
|
||||
S.UIntervals(TI, GeomAbs_CN);
|
||||
U1 = Max(T1, TI(1));
|
||||
U2 = Min(T2, TI(2));
|
||||
V1 = Par;
|
||||
V2 = Par;
|
||||
stepV = 0;
|
||||
nbIntv = nbUIntv;
|
||||
}
|
||||
|
||||
S.D0(U1,V1,P);
|
||||
MoveTo(P,Pts);
|
||||
|
||||
for (Intrv = 1; Intrv <= nbIntv; Intrv++) {
|
||||
|
||||
if (TI(Intrv) <= T1 && TI(Intrv + 1) <= T1)
|
||||
continue;
|
||||
if (TI(Intrv) >= T2 && TI(Intrv + 1) >= T2)
|
||||
continue;
|
||||
if (T == GeomAbs_IsoU) {
|
||||
V1 = Max(T1, TI(Intrv));
|
||||
V2 = Min(T2, TI(Intrv + 1));
|
||||
stepV = (V2 - V1) / myDiscret;
|
||||
}
|
||||
else {
|
||||
U1 = Max(T1, TI(Intrv));
|
||||
U2 = Min(T2, TI(Intrv + 1));
|
||||
stepU = (U2 - U1) / myDiscret;
|
||||
}
|
||||
|
||||
switch (SurfType) {
|
||||
//-------------GeomAbs_Plane---------------
|
||||
case GeomAbs_Plane :
|
||||
break;
|
||||
//----GeomAbs_Cylinder GeomAbs_Cone------
|
||||
case GeomAbs_Cylinder :
|
||||
case GeomAbs_Cone :
|
||||
if (T == GeomAbs_IsoV) {
|
||||
for (j = 1; j < myDiscret; j++) {
|
||||
U1 += stepU;
|
||||
V1 += stepV;
|
||||
S.D0(U1,V1,P);
|
||||
DrawTo(P,Pts,Cells);
|
||||
}
|
||||
}
|
||||
break;
|
||||
//---GeomAbs_Sphere GeomAbs_Torus--------
|
||||
//GeomAbs_BezierSurface GeomAbs_BezierSurface
|
||||
case GeomAbs_Sphere :
|
||||
case GeomAbs_Torus :
|
||||
case GeomAbs_OffsetSurface :
|
||||
case GeomAbs_OtherSurface :
|
||||
for (j = 1; j < myDiscret; j++) {
|
||||
U1 += stepU;
|
||||
V1 += stepV;
|
||||
S.D0(U1,V1,P);
|
||||
DrawTo(P,Pts,Cells);
|
||||
}
|
||||
break;
|
||||
//-------------GeomAbs_BSplineSurface------
|
||||
case GeomAbs_BezierSurface :
|
||||
case GeomAbs_BSplineSurface :
|
||||
for (j = 1; j <= myDiscret/2; j++) {
|
||||
|
||||
PlotCount = 0;
|
||||
|
||||
PlotIso ( S, T, U1, V1, (T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells);
|
||||
U1 += stepU*2.;
|
||||
V1 += stepV*2.;
|
||||
}
|
||||
break;
|
||||
//-------------GeomAbs_SurfaceOfExtrusion--
|
||||
//-------------GeomAbs_SurfaceOfRevolution-
|
||||
case GeomAbs_SurfaceOfExtrusion :
|
||||
case GeomAbs_SurfaceOfRevolution :
|
||||
if ((T == GeomAbs_IsoV && SurfType == GeomAbs_SurfaceOfRevolution) ||
|
||||
(T == GeomAbs_IsoU && SurfType == GeomAbs_SurfaceOfExtrusion)) {
|
||||
if (SurfType == GeomAbs_SurfaceOfExtrusion) break;
|
||||
for (j = 1; j < myDiscret; j++) {
|
||||
U1 += stepU;
|
||||
V1 += stepV;
|
||||
S.D0(U1,V1,P);
|
||||
DrawTo(P,Pts,Cells);
|
||||
}
|
||||
} else {
|
||||
CurvType = (S.BasisCurve())->GetType();
|
||||
switch (CurvType) {
|
||||
case GeomAbs_Line :
|
||||
break;
|
||||
case GeomAbs_Circle :
|
||||
case GeomAbs_Ellipse :
|
||||
for (j = 1; j < myDiscret; j++) {
|
||||
U1 += stepU;
|
||||
V1 += stepV;
|
||||
S.D0(U1,V1,P);
|
||||
DrawTo(P,Pts,Cells);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola :
|
||||
case GeomAbs_Hyperbola :
|
||||
case GeomAbs_BezierCurve :
|
||||
case GeomAbs_BSplineCurve :
|
||||
case GeomAbs_OtherCurve :
|
||||
for (j = 1; j <= myDiscret/2; j++) {
|
||||
|
||||
PlotCount = 0;
|
||||
|
||||
PlotIso ( S, T, U1, V1,(T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells);
|
||||
U1 += stepU*2.;
|
||||
V1 += stepV*2.;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
S.D0(U2,V2,P);
|
||||
DrawTo(P,Pts,Cells);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : PlotIso
|
||||
// Purpose : Plot iso for other surface
|
||||
//=======================================================================
|
||||
|
||||
void GEOM_OCCReader::PlotIso (BRepAdaptor_Surface& S,
|
||||
GeomAbs_IsoType T,
|
||||
Standard_Real& U,
|
||||
Standard_Real& V,
|
||||
Standard_Real Step,
|
||||
Standard_Boolean& halt,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells)
|
||||
{
|
||||
|
||||
++PlotCount;
|
||||
|
||||
gp_Pnt Pl, Pr, Pm;
|
||||
|
||||
if (T == GeomAbs_IsoU) {
|
||||
S.D0(U, V, Pl);
|
||||
S.D0(U, V + Step/2., Pm);
|
||||
S.D0(U, V + Step, Pr);
|
||||
} else {
|
||||
S.D0(U, V, Pl);
|
||||
S.D0(U + Step/2., V, Pm);
|
||||
S.D0(U + Step, V, Pr);
|
||||
}
|
||||
|
||||
if (PlotCount > MaxPlotCount) {
|
||||
DrawTo(Pr,Pts,Cells);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Pm.Distance(Pl) + Pm.Distance(Pr) <= IsoRatio*Pl.Distance(Pr)) {
|
||||
DrawTo(Pr,Pts,Cells);
|
||||
} else
|
||||
if (T == GeomAbs_IsoU) {
|
||||
PlotIso ( S, T, U, V, Step/2, halt, Pts, Cells);
|
||||
Standard_Real aLocalV = V + Step/2 ;
|
||||
PlotIso ( S, T, U, aLocalV , Step/2, halt, Pts, Cells);
|
||||
} else {
|
||||
PlotIso ( S, T, U, V, Step/2, halt, Pts, Cells);
|
||||
Standard_Real aLocalU = U + Step/2 ;
|
||||
PlotIso ( S, T, aLocalU , V, Step/2, halt, Pts, Cells);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TransferEdgeWData
|
||||
// Purpose : Transfert wireframe data for EDGE
|
||||
//=======================================================================
|
||||
|
||||
void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells) {
|
||||
|
||||
|
||||
Handle(Poly_PolygonOnTriangulation) aEdgePoly;
|
||||
Standard_Integer i = 1;
|
||||
Handle(Poly_Triangulation) T;
|
||||
TopLoc_Location aEdgeLoc;
|
||||
BRep_Tool::PolygonOnTriangulation(aEdge, aEdgePoly, T, aEdgeLoc, i);
|
||||
|
||||
Handle(Poly_Polygon3D) P;
|
||||
if(aEdgePoly.IsNull()) {
|
||||
P = BRep_Tool::Polygon3D(aEdge, aEdgeLoc);
|
||||
}
|
||||
|
||||
if(P.IsNull() && aEdgePoly.IsNull())
|
||||
return;
|
||||
|
||||
// Location edges
|
||||
//---------------
|
||||
|
||||
gp_Trsf edgeTransf;
|
||||
Standard_Boolean isidtrsf = true;
|
||||
if(!aEdgeLoc.IsIdentity()) {
|
||||
isidtrsf = false;
|
||||
edgeTransf = aEdgeLoc.Transformation();
|
||||
}
|
||||
|
||||
Standard_Integer nbnodes;
|
||||
if (aEdgePoly.IsNull()) {
|
||||
nbnodes = P->NbNodes();
|
||||
const TColgp_Array1OfPnt& theNodesP = P->Nodes();
|
||||
|
||||
float coord[3];
|
||||
int pts[2];
|
||||
|
||||
for(int j=1;j<nbnodes;j++) {
|
||||
gp_Pnt pt1 = theNodesP(j);
|
||||
gp_Pnt pt2 = theNodesP(j+1);
|
||||
|
||||
if(!isidtrsf) {
|
||||
// apply edge transformation
|
||||
pt1.Transform(edgeTransf);
|
||||
pt2.Transform(edgeTransf);
|
||||
}
|
||||
|
||||
// insert pt1
|
||||
coord[0] = pt1.X(); coord[1] = pt1.Y(); coord[2] = pt1.Z();
|
||||
pts[0] = Pts->InsertNextPoint(coord);
|
||||
|
||||
// insert pt2
|
||||
coord[0] = pt2.X(); coord[1] = pt2.Y(); coord[2] = pt2.Z();
|
||||
pts[1] = Pts->InsertNextPoint(coord);
|
||||
|
||||
// insert line (pt1,pt2)
|
||||
Cells->InsertNextCell(2,pts);
|
||||
}
|
||||
} else {
|
||||
nbnodes = aEdgePoly->NbNodes();
|
||||
const TColStd_Array1OfInteger& Nodesidx = aEdgePoly->Nodes();
|
||||
const TColgp_Array1OfPnt& theNodesPoly = T->Nodes();
|
||||
|
||||
float coord[3];
|
||||
int pts[2];
|
||||
|
||||
for(int j=1;j<nbnodes;j++) {
|
||||
Standard_Integer id1 = Nodesidx(j);
|
||||
Standard_Integer id2 = Nodesidx(j+1);
|
||||
|
||||
gp_Pnt pt1 = theNodesPoly(id1);
|
||||
gp_Pnt pt2 = theNodesPoly(id2);
|
||||
|
||||
if(!isidtrsf) {
|
||||
// apply edge transformation
|
||||
pt1.Transform(edgeTransf);
|
||||
pt2.Transform(edgeTransf);
|
||||
}
|
||||
|
||||
// insert pt1
|
||||
coord[0] = pt1.X(); coord[1] = pt1.Y(); coord[2] = pt1.Z();
|
||||
pts[0] = Pts->InsertNextPoint(coord);
|
||||
|
||||
// insert pt2
|
||||
coord[0] = pt2.X(); coord[1] = pt2.Y(); coord[2] = pt2.Z();
|
||||
pts[1] = Pts->InsertNextPoint(coord);
|
||||
|
||||
// insert line (pt1,pt2)
|
||||
Cells->InsertNextCell(2,pts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Standard_Integer nbnodes = aEdgePoly->NbNodes();
|
||||
const TColStd_Array1OfInteger& Nodesidx = aEdgePoly->Nodes();
|
||||
const TColgp_Array1OfPnt& theNodes = T->Nodes();
|
||||
|
||||
float coord[3];
|
||||
int pts[2];
|
||||
|
||||
|
||||
// PUSH NODES
|
||||
for(i=1;i<=nbnodes;i++) {
|
||||
Standard_Integer id = Nodesidx(i);
|
||||
gp_Pnt pt = theNodes(id);
|
||||
|
||||
float coord[3];
|
||||
if(!isidtrsf) pt.Transform(edgeTransf);
|
||||
|
||||
coord[0] = pt.X(); coord[1] = pt.Y(); coord[2] = pt.Z();
|
||||
|
||||
Pts->SetPoint(id-1,coord);
|
||||
|
||||
}
|
||||
|
||||
// PUSH EDGES
|
||||
for(i=1;i<nbnodes;i++) {
|
||||
|
||||
Standard_Integer id1 = Nodesidx(i);
|
||||
Standard_Integer id2 = Nodesidx(i+1);
|
||||
|
||||
int pts[2];
|
||||
pts[0] = id1-1; pts[1] = id2-1;
|
||||
|
||||
// insert line (pt1,pt2)
|
||||
Cells->InsertNextCell(2,pts);
|
||||
}
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
//=======================================================================
|
||||
// Function : TransferVertexWData
|
||||
// Purpose : Transfert wireframe data for VERTEX
|
||||
//=======================================================================
|
||||
|
||||
void GEOM_OCCReader::TransferVertexWData(const TopoDS_Vertex& aVertex,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells) {
|
||||
#define ZERO_COORD coord[0] = 0.0; coord[1] = 0.0; coord[2] = 0.0
|
||||
|
||||
gp_Pnt P = BRep_Tool::Pnt( aVertex );
|
||||
float delta = 1, coord[3];
|
||||
int pts[2];
|
||||
// insert pt
|
||||
ZERO_COORD; coord[0] = +delta;
|
||||
pts[0] = Pts->InsertNextPoint(coord);
|
||||
coord[0] = -delta;
|
||||
pts[1] = Pts->InsertNextPoint(coord);
|
||||
// insert line (pt1,pt2)
|
||||
Cells->InsertNextCell(2,pts);
|
||||
|
||||
ZERO_COORD; coord[1] = +delta;
|
||||
pts[0] = Pts->InsertNextPoint(coord);
|
||||
coord[1] = -delta;
|
||||
pts[1] = Pts->InsertNextPoint(coord);
|
||||
// insert line (pt1,pt2)
|
||||
Cells->InsertNextCell(2,pts);
|
||||
|
||||
ZERO_COORD; coord[2] = +delta;
|
||||
pts[0] = Pts->InsertNextPoint(coord);
|
||||
coord[2] = -delta;
|
||||
pts[1] = Pts->InsertNextPoint(coord);
|
||||
// insert line (pt1,pt2)
|
||||
Cells->InsertNextCell(2,pts);
|
||||
|
||||
#undef ZERO_COORD
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TransferEdgeSData(
|
||||
// Purpose : Transfert shading data for EDGE
|
||||
//=======================================================================
|
||||
|
||||
void GEOM_OCCReader::TransferEdgeSData(const TopoDS_Edge& aFace,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// Function : TransferFaceSData
|
||||
// Purpose : Transfert shading data for FACE
|
||||
//=======================================================================
|
||||
void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells) {
|
||||
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
|
||||
if(aPoly.IsNull()) return;
|
||||
else {
|
||||
|
||||
gp_Trsf myTransf;
|
||||
Standard_Boolean identity = true;
|
||||
if(!aLoc.IsIdentity()) {
|
||||
identity = false;
|
||||
myTransf = aLoc.Transformation();
|
||||
}
|
||||
|
||||
Standard_Integer nbNodesInFace = aPoly->NbNodes();
|
||||
Standard_Integer nbTriInFace = aPoly->NbTriangles();
|
||||
|
||||
const Poly_Array1OfTriangle& Triangles = aPoly->Triangles();
|
||||
const TColgp_Array1OfPnt& Nodes = aPoly->Nodes();
|
||||
|
||||
Standard_Integer i;
|
||||
for(i=1;i<=nbNodesInFace;i++) {
|
||||
gp_Pnt P = Nodes(i);
|
||||
float coord[3];
|
||||
if(!identity) P.Transform(myTransf);
|
||||
coord[0] = P.X(); coord[1] = P.Y(); coord[2] = P.Z();
|
||||
Pts->SetPoint(i-1,coord);
|
||||
}
|
||||
|
||||
for(i=1;i<=nbTriInFace;i++) {
|
||||
// Get the triangle
|
||||
|
||||
Standard_Integer N1,N2,N3;
|
||||
Triangles(i).Get(N1,N2,N3);
|
||||
|
||||
int pts[3];
|
||||
pts[0] = N1-1; pts[1] = N2-1; pts[2] = N3-1;
|
||||
Cells->InsertNextCell(3,pts);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ComputeShading
|
||||
// Purpose : Compute the shape in shading mode
|
||||
//=======================================================================
|
||||
void GEOM_OCCReader::ComputeShading(vtkPoints* Pts,vtkCellArray* Cells){
|
||||
|
||||
// Check the type of the shape:
|
||||
if(myShape.ShapeType() == TopAbs_FACE) {
|
||||
// Face
|
||||
TransferFaceSData(TopoDS::Face(myShape),Pts,Cells);
|
||||
}
|
||||
else {
|
||||
if(myShape.ShapeType() == TopAbs_EDGE) {
|
||||
// Edge
|
||||
TransferEdgeSData(TopoDS::Edge(myShape),Pts,Cells);
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function :
|
||||
// Purpose : Set parameters
|
||||
//=======================================================================
|
||||
void GEOM_OCCReader::setDisplayMode(int thenewmode) {
|
||||
amode = thenewmode;
|
||||
}
|
||||
|
||||
void GEOM_OCCReader::setTopo(const TopoDS_Shape& aShape) {
|
||||
myShape = aShape;
|
||||
}
|
||||
|
||||
void GEOM_OCCReader::setForceUpdate(Standard_Boolean bol) {
|
||||
forced = bol;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function :
|
||||
// Purpose : Get parameters
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& GEOM_OCCReader::getTopo() {
|
||||
return myShape;
|
||||
}
|
||||
|
||||
int GEOM_OCCReader::getDisplayMode() {
|
||||
return amode;
|
||||
}
|
||||
|
||||
|
122
src/OBJECT/GEOM_OCCReader.h
Normal file
122
src/OBJECT/GEOM_OCCReader.h
Normal file
@ -0,0 +1,122 @@
|
||||
// File : GEOM_OCCReader.h
|
||||
// Created : Wed Feb 20 17:24:59 2002
|
||||
// Author : Christophe ATTANASIO
|
||||
// Project : SALOME
|
||||
// Module : GEOM
|
||||
// Copyright : Open CASCADE 2002
|
||||
// $Header$
|
||||
|
||||
/*!
|
||||
\class GEOM_OCCReader GEOM_OCCReader.h
|
||||
\brief This class allow to display a OpenCASCADE CAD model in a VTK viewer.
|
||||
*/
|
||||
|
||||
#ifndef GEOM_OCCREADER_H
|
||||
#define GEOM_OCCREADER_H
|
||||
|
||||
// VTK
|
||||
#include <vtkPolyDataSource.h>
|
||||
#include <vtkPoints.h>
|
||||
#include <vtkCellArray.h>
|
||||
|
||||
// OpenCASCADE
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <Poly_Polygon3D.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
|
||||
#ifdef _WIN_32
|
||||
#define VTKOCC_EXPORT __declspec (dllexport)
|
||||
#else
|
||||
#define VTKOCC_EXPORT
|
||||
#endif
|
||||
class VTKOCC_EXPORT GEOM_OCCReader : public vtkPolyDataSource {
|
||||
|
||||
// methods
|
||||
|
||||
public:
|
||||
|
||||
static GEOM_OCCReader* New();
|
||||
|
||||
const TopoDS_Shape& getTopo();
|
||||
|
||||
void setTopo(const TopoDS_Shape& ashape);
|
||||
|
||||
int getDisplayMode();
|
||||
void setDisplayMode(int);
|
||||
|
||||
void setForceUpdate(Standard_Boolean bol);
|
||||
|
||||
protected:
|
||||
|
||||
GEOM_OCCReader();
|
||||
~GEOM_OCCReader();
|
||||
void Execute();
|
||||
|
||||
void ComputeShading(vtkPoints* Pts,vtkCellArray* Cells);
|
||||
void ComputeWireframe(vtkPoints* Pts,vtkCellArray* Cells);
|
||||
|
||||
void TransferFaceSData(const TopoDS_Face& aFace,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
void TransferFaceWData(const TopoDS_Face& aFace,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
void TransferEdgeSData(const TopoDS_Edge& aEdge,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
void TransferEdgeWData(const TopoDS_Edge& aEdge,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
void TransferVertexWData(const TopoDS_Vertex& aVertex,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
void createISO(const TopoDS_Face &,
|
||||
double, int,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
void DrawIso(GeomAbs_IsoType aType,
|
||||
Standard_Real PParm,
|
||||
Standard_Real p1,
|
||||
Standard_Real p2,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells,
|
||||
Standard_Integer& startidx);
|
||||
|
||||
void MoveTo(gp_Pnt P,
|
||||
vtkPoints* Pts);
|
||||
|
||||
void DrawTo(gp_Pnt P,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
void PlotIso(BRepAdaptor_Surface& S,
|
||||
GeomAbs_IsoType T,
|
||||
Standard_Real& U,
|
||||
Standard_Real& V,
|
||||
Standard_Real Step,
|
||||
Standard_Boolean& halt,
|
||||
vtkPoints* Pts,
|
||||
vtkCellArray* Cells);
|
||||
|
||||
// fields
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean forced;
|
||||
int discretiso;
|
||||
int amode;
|
||||
int nbisos;
|
||||
TopoDS_Shape myShape;
|
||||
|
||||
};
|
||||
|
||||
#endif //GEOM_OCCREADER_H
|
89
src/OBJECT/Handle_GEOM_AISShape.hxx
Normal file
89
src/OBJECT/Handle_GEOM_AISShape.hxx
Normal file
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _Handle_GEOM_AISShape_HeaderFile
|
||||
#define _Handle_GEOM_AISShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_SALOME_AISShape_HeaderFile
|
||||
#include "Handle_SALOME_AISShape.hxx"
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(SALOME_AISShape);
|
||||
class GEOM_AISShape;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_AISShape);
|
||||
|
||||
class Handle(GEOM_AISShape) : public Handle(SALOME_AISShape) {
|
||||
public:
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
Handle(GEOM_AISShape)():Handle(SALOME_AISShape)() {}
|
||||
Handle(GEOM_AISShape)(const Handle(GEOM_AISShape)& aHandle) : Handle(SALOME_AISShape)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_AISShape)(const GEOM_AISShape* anItem) : Handle(SALOME_AISShape)((SALOME_AISShape *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_AISShape)& operator=(const Handle(GEOM_AISShape)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(GEOM_AISShape)& operator=(const GEOM_AISShape* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEOM_AISShape* operator->()
|
||||
{
|
||||
return (GEOM_AISShape *)ControlAccess();
|
||||
}
|
||||
|
||||
GEOM_AISShape* operator->() const
|
||||
{
|
||||
return (GEOM_AISShape *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(GEOM_AISShape)();
|
||||
|
||||
Standard_EXPORT static const Handle(GEOM_AISShape) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
89
src/OBJECT/Handle_GEOM_InteractiveObject.hxx
Normal file
89
src/OBJECT/Handle_GEOM_InteractiveObject.hxx
Normal file
@ -0,0 +1,89 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
//
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
|
||||
#ifndef _Handle_GEOM_InteractiveObject_HeaderFile
|
||||
#define _Handle_GEOM_InteractiveObject_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
|
||||
#include "Handle_SALOME_InteractiveObject.hxx"
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(SALOME_InteractiveObject);
|
||||
class GEOM_InteractiveObject;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_InteractiveObject);
|
||||
|
||||
class Handle(GEOM_InteractiveObject) : public Handle(SALOME_InteractiveObject) {
|
||||
public:
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
Handle(GEOM_InteractiveObject)():Handle(SALOME_InteractiveObject)() {}
|
||||
Handle(GEOM_InteractiveObject)(const Handle(GEOM_InteractiveObject)& aHandle) : Handle(SALOME_InteractiveObject)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_InteractiveObject)(const GEOM_InteractiveObject* anItem) : Handle(SALOME_InteractiveObject)((SALOME_InteractiveObject *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(GEOM_InteractiveObject)& operator=(const Handle(GEOM_InteractiveObject)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(GEOM_InteractiveObject)& operator=(const GEOM_InteractiveObject* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEOM_InteractiveObject* operator->()
|
||||
{
|
||||
return (GEOM_InteractiveObject *)ControlAccess();
|
||||
}
|
||||
|
||||
GEOM_InteractiveObject* operator->() const
|
||||
{
|
||||
return (GEOM_InteractiveObject *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(GEOM_InteractiveObject)();
|
||||
|
||||
Standard_EXPORT static const Handle(GEOM_InteractiveObject) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
41
src/OBJECT/Makefile.in
Normal file
41
src/OBJECT/Makefile.in
Normal file
@ -0,0 +1,41 @@
|
||||
# source path
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
VPATH=.:$(srcdir):$(top_srcdir)/idl:$(top_builddir)/idl
|
||||
|
||||
|
||||
@COMMENCE@
|
||||
|
||||
EXPORT_HEADERS = GEOM_Actor.h \
|
||||
GEOM_AssemblyBuilder.h \
|
||||
GEOM_AISShape.hxx \
|
||||
Handle_GEOM_AISShape.hxx \
|
||||
GEOM_InteractiveObject.hxx \
|
||||
Handle_GEOM_InteractiveObject.hxx
|
||||
|
||||
|
||||
# Libraries targets
|
||||
|
||||
LIB = libGeometryObject.la
|
||||
LIB_SRC = GEOM_Actor.cxx \
|
||||
GEOM_OCCReader.cxx \
|
||||
GEOM_AssemblyBuilder.cxx \
|
||||
GEOM_AISShape.cxx \
|
||||
GEOM_InteractiveObject.cxx
|
||||
|
||||
LIB_CLIENT_IDL =
|
||||
|
||||
# Executables targets
|
||||
BIN =
|
||||
BIN_SRC =
|
||||
|
||||
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||
LDFLAGS+=$(QT_MT_LIBS) $(OCC_LIBS) $(VTK_LIBS) $(OGL_LIBS) $(PYTHON_LIBS) -lSalomeObject -L${KERNEL_ROOT_DIR}/lib/salome
|
||||
|
||||
%_moc.cxx: %.h
|
||||
$(MOC) $< -o $@
|
||||
|
||||
|
||||
@CONCLUDE@
|
1372
src/SKETCHER/GEOM_Sketcher.cxx
Normal file
1372
src/SKETCHER/GEOM_Sketcher.cxx
Normal file
File diff suppressed because it is too large
Load Diff
184
src/SKETCHER/GEOM_Sketcher.h
Normal file
184
src/SKETCHER/GEOM_Sketcher.h
Normal file
@ -0,0 +1,184 @@
|
||||
// File : GEOM_Sketcher.h
|
||||
// Created : Wed Jul 5 10:12:09 2000
|
||||
// Author : Martine LANGLOIS
|
||||
|
||||
// Modified : Tue Dec 11 21:23:41 2001
|
||||
// Author : Nicolas REJNERI
|
||||
// Project : SALOME
|
||||
// Module : SALOMEGUI
|
||||
// Copyright : Open CASCADE
|
||||
// $Header$
|
||||
|
||||
#include "GEOM_SketcherStatus.h"
|
||||
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Axis.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <AIS_LengthDimension.hxx>
|
||||
#include <AIS_RadiusDimension.hxx>
|
||||
#include <AIS_AngleDimension.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <TColgp_SequenceOfPnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
class Sketch
|
||||
{
|
||||
public:
|
||||
Sketch();
|
||||
~Sketch();
|
||||
Sketch(const Handle(V3d_Viewer)& aViewer);
|
||||
Sketch(const Handle(V3d_Viewer)& aViewer,
|
||||
const Quantity_Color& anAxisColor,
|
||||
const Quantity_Color& aCurrentColor,
|
||||
const Quantity_Color& aWireColor);
|
||||
|
||||
static void fitInResol(Standard_Real &toFit,
|
||||
Standard_Boolean minIsResol = Standard_False);
|
||||
|
||||
void MakeCurrentEdge(const Standard_Integer Xp ,
|
||||
const Standard_Integer Yp ,
|
||||
const Handle(V3d_View)& aView );
|
||||
|
||||
void MakeCurrentEdge(const Standard_Real X, const Standard_Real Y);
|
||||
|
||||
Standard_Boolean SetDimension(Standard_Real& aValue);
|
||||
void SetDimension(Standard_Real& deltaX,Standard_Real& deltaY);
|
||||
|
||||
void SetXDimension(Standard_Real& deltaX);
|
||||
void SetYDimension(Standard_Real& deltaY);
|
||||
|
||||
void SetSegmentAngle(Standard_Real& aValue);
|
||||
Standard_Real GetSegmentAngle();
|
||||
|
||||
void ValidateEdge();
|
||||
|
||||
TopoDS_Wire Close();
|
||||
TopoDS_Wire End();
|
||||
|
||||
void Clear();
|
||||
|
||||
Standard_Boolean Delete();
|
||||
|
||||
void SetPlane(const Handle(Geom_Plane)& aPlane);
|
||||
|
||||
void SetWireColor(const Quantity_Color& aColor);
|
||||
void SetCurrentColor(const Quantity_Color& aColor);
|
||||
void SetAxisColor(const Quantity_Color& aColor);
|
||||
|
||||
void SetParameterVisibility(const TypeOfParameter atype,
|
||||
const Standard_Boolean OnOff);
|
||||
|
||||
void HiligthWithColor(const TypeOfParameter atype,
|
||||
const Quantity_NameOfColor acolor);
|
||||
void Unhiligth(const TypeOfParameter atype);
|
||||
|
||||
Standard_Boolean IsValidCurrentParameter(const TypeOfParameter atype);
|
||||
|
||||
void SetParameterValue(const TypeOfParameter atype, Standard_Real aValue);
|
||||
|
||||
void ChangeMode(const SketchStatus aMode);
|
||||
|
||||
void SetTransitionStatus(const TransitionStatus aStatus);
|
||||
|
||||
SketchStatus GetCurrentStatus();
|
||||
Standard_Integer GetmyEdgesNumber();
|
||||
|
||||
private :
|
||||
|
||||
void Init();
|
||||
|
||||
void MakeCurrentSegment(Standard_Real X, Standard_Real Y);
|
||||
|
||||
void MakeCurrentArc(Standard_Real X, Standard_Real Y);
|
||||
|
||||
void DisplayCurrentEdge();
|
||||
|
||||
void DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
|
||||
void DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
|
||||
void DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
|
||||
void DisplayAngleDimension();
|
||||
void DisplayRadiusDimension();
|
||||
|
||||
void AddEdgeToWire();
|
||||
|
||||
void RemoveLastEdge();
|
||||
|
||||
void CreateConstraints();
|
||||
|
||||
private:
|
||||
// Current status of construction
|
||||
SketchStatus myCurrentStatus;
|
||||
// Transition status between arcs and segments
|
||||
TransitionStatus myTransitionStatus;
|
||||
// Current wire
|
||||
BRepBuilderAPI_MakeWire myCurrentWire;
|
||||
// Current presentable wire
|
||||
Handle_AIS_Shape myPresentableWire;
|
||||
// Number of edges into the current wire
|
||||
Standard_Integer myEdgesNumber;
|
||||
// Store for each edge how it has been built i.d the value of myCurrentStatus
|
||||
TColStd_SequenceOfInteger myConstructionMode;
|
||||
// Store for each edge how it has been built i.d the value of myTransitionStatus
|
||||
TColStd_SequenceOfInteger myConstraintMode;
|
||||
// Current edge
|
||||
TopoDS_Shape myCurrentEdge;
|
||||
// Previous edge
|
||||
TopoDS_Edge myPreviousEdge;
|
||||
// List of points to interpolate when computing a curve by interpolation
|
||||
TColgp_SequenceOfPnt2d myPointsToInterpolate;
|
||||
// Tangent vector at beginning of curve
|
||||
gp_Vec2d myTangentVector;
|
||||
// Tangent flag at beginning og curve
|
||||
Standard_Boolean myTangentFlag;
|
||||
|
||||
// Origin of sketch
|
||||
TopoDS_Vertex myFirstPointSketch;
|
||||
// Last x coordinate of end point of previous edge or picked point
|
||||
Standard_Real myLastX;
|
||||
// Last y coordinate of end point of previous edge or picked point
|
||||
Standard_Real myLastY;
|
||||
// angle between 2 segments when an ANGLE TransitionStatus is set.
|
||||
Standard_Real mySegmentAngle;
|
||||
// Length of segment when the length of the segment is fixed before the angle
|
||||
Standard_Real mySegmentLength;
|
||||
// Value of X fixed coordinate
|
||||
Standard_Real mySegmentX;
|
||||
// Value of Y fixed Coordinate
|
||||
Standard_Real mySegmentY;
|
||||
Handle_AIS_Shape myPresentableEdge; // Current presentable edge
|
||||
Handle_AIS_LengthDimension myLengthDimension;// For display of current length segment dimension
|
||||
Handle_AIS_LengthDimension myXDimension; // For display of current X segment dimension
|
||||
Handle_AIS_LengthDimension myYDimension; // For display of current Y segment dimension
|
||||
Handle_AIS_LengthDimension myRadiusDimension;// For display of current radius dimension
|
||||
Handle_AIS_AngleDimension myAngleDimension; // For display of current angle dimension
|
||||
Standard_Boolean myIsLengthDimensionVisible; // Visibility flag for LengthDimension
|
||||
Standard_Boolean myIsXDimensionVisible; // Visibility flag for X Dimension
|
||||
Standard_Boolean myIsYDimensionVisible; // Visibility flag for Y Dimension
|
||||
Standard_Boolean myIsRadiusDimensionVisible; // Visibility flag for RadiusDimension
|
||||
Standard_Boolean myIsAngleDimensionVisible; // Visibility flag for AngleDimension
|
||||
Handle_AIS_Axis myPresentableMediatrice; // Chord mediatrice of current circle as a presentable object
|
||||
Handle_Geom2d_Line myMediatrice; // Chord mediatrice of current circle as a 2d line
|
||||
Handle_AIS_Shape myCenterCircle; // to visualise center of current arc
|
||||
|
||||
Handle_AIS_Axis myHAxis; // Horizontal axis
|
||||
Handle_AIS_Axis myVAxis; // Vertical axis
|
||||
Handle_AIS_Axis myAngularAxis; // Axis making a predefined angle with the previous edge
|
||||
|
||||
Quantity_Color myWireColor; // Color of wire and of build edges
|
||||
Quantity_Color myCurrentColor; // Color of edge under construction
|
||||
Quantity_Color myAxisColor; // Color for axis
|
||||
Handle_AIS_InteractiveContext myInteractiveContext; // Interactive context for display management
|
||||
|
||||
Handle_Geom_Plane myPlane; // Plane of sketch
|
||||
|
||||
BRepBuilderAPI_MakeWire myPasteWire;
|
||||
Standard_Integer myPasteEdgesNumber;
|
||||
TColStd_SequenceOfInteger myPasteConstructionMode;
|
||||
TColStd_SequenceOfInteger myPasteConstraintMode;
|
||||
};
|
36
src/SKETCHER/GEOM_SketcherStatus.h
Normal file
36
src/SKETCHER/GEOM_SketcherStatus.h
Normal file
@ -0,0 +1,36 @@
|
||||
// File : GEOM_SketcherStatus.h
|
||||
// Created : Wed Jul 5 10:12:09 2000
|
||||
// Author : Martine LANGLOIS
|
||||
|
||||
// Modified : Tue Dec 11 21:29:57 2001
|
||||
// Author : Nicolas REJNERI
|
||||
// Project : SALOME
|
||||
// Module : SALOMEGUI
|
||||
// Copyright : Open CASCADE
|
||||
// $Header$
|
||||
|
||||
enum TransitionStatus {
|
||||
NOCONSTRAINT, // no constraint between consecutive edges
|
||||
TANGENT, // arc and segment are tangent
|
||||
PERPENDICULAR,// arc is tangent to the perpendicular to the segment
|
||||
ANGLE, // Angular constraint between 2 segments
|
||||
LENGTH_FIXED, // Length of segment has been fixed
|
||||
X_FIXED, // X coordinate for segment has been fixed
|
||||
Y_FIXED // Y coordinate for segment has been fixed
|
||||
};
|
||||
|
||||
enum TypeOfParameter {
|
||||
ANGLE_PARAMETER,
|
||||
LENGTH_PARAMETER,
|
||||
RADIUS_PARAMETER,
|
||||
XVALUE_PARAMETER,
|
||||
YVALUE_PARAMETER
|
||||
};
|
||||
|
||||
enum SketchStatus {
|
||||
BEGIN_SKETCH, // Begin sketch; no edges created yet
|
||||
SEGMENT, // Current mode for creation is segment
|
||||
ARC_CHORD, // Current mode for creation is arc by chord
|
||||
ARC_CHORD_END,// Chord validated, waiting for radius or center
|
||||
END_SKETCH // End sketch
|
||||
};
|
37
src/SKETCHER/Makefile.in
Normal file
37
src/SKETCHER/Makefile.in
Normal file
@ -0,0 +1,37 @@
|
||||
# -* Makefile *-
|
||||
#
|
||||
# Author : Patrick GOLDBRONN (CEA)
|
||||
# Date : 29/06/2001
|
||||
# $Header$
|
||||
#
|
||||
|
||||
# source path
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
VPATH=.:$(srcdir):$(top_srcdir)/idl:$(top_builddir)/idl
|
||||
|
||||
@COMMENCE@
|
||||
|
||||
# Libraries targets
|
||||
|
||||
LIB = libGeometrySketcher.la
|
||||
LIB_SRC = GEOM_Sketcher.cxx
|
||||
LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS= GEOM_Sketcher.h \
|
||||
GEOM_SketcherStatus.h
|
||||
|
||||
# additionnal information to compil and link file
|
||||
CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
LDFLAGS += $(OCC_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
|
||||
|
||||
# additional file to be cleaned
|
||||
MOSTLYCLEAN =
|
||||
CLEAN =
|
||||
DISTCLEAN =
|
||||
|
||||
@CONCLUDE@
|
||||
|
Loading…
Reference in New Issue
Block a user