2 // File: SMDSEdit_Transform.cxx
3 // Created: Wed May 15 21:57:17 2002
4 // Author: Jean-Michel BOULCOURT
5 // <jmb@localhost.localdomain>
8 #include "SMDSEdit_Transform.ixx"
9 #include "SMDS_MeshNode.hxx"
10 #include "SMDS_MeshElement.hxx"
11 #include "SMDS_MeshNodesIterator.hxx"
12 #include "SMDS_ListIteratorOfListOfMeshElement.hxx"
13 #include "TColStd_MapOfInteger.hxx"
16 //=======================================================================
17 //function : SMDSEdit_Transform
19 //=======================================================================
21 SMDSEdit_Transform::SMDSEdit_Transform(const Handle(SMDS_Mesh)& aMesh,const gp_Trsf& aTrsf)
22 :myMesh(aMesh),myTrsf(aTrsf)
26 //=======================================================================
27 //function : SMDSEdit_Transform
29 //=======================================================================
31 SMDSEdit_Transform::SMDSEdit_Transform(const Handle(SMDS_Mesh)& aMesh,
32 const SMDS_ListOfMeshElement& aListOfME,
34 :myMesh(aMesh),myTrsf(aTrsf)
36 myListOfME = aListOfME;
39 //=======================================================================
42 //=======================================================================
44 void SMDSEdit_Transform::SetTrsf(const gp_Trsf& aTrsf)
49 //=======================================================================
52 //=======================================================================
54 gp_Trsf SMDSEdit_Transform::GetTrsf() const
59 //=======================================================================
62 //=======================================================================
64 void SMDSEdit_Transform::Perform()
66 if (myListOfME.IsEmpty()) {
67 // transform the whole mesh
68 SMDS_MeshNodesIterator itNodes(myMesh);
70 for (;itNodes.More();itNodes.Next()) {
71 const Handle(SMDS_MeshElement)& elem = itNodes.Value();
72 Handle(SMDS_MeshNode) node = *((Handle(SMDS_MeshNode)*)&elem);
74 gp_Pnt P = node->Pnt();
80 TColStd_MapOfInteger mapnode;
81 Standard_Integer nbnodes,inode;
83 SMDS_ListIteratorOfListOfMeshElement itME(myListOfME);
84 for (;itME.More();itME.Next()) {
85 const Handle(SMDS_MeshElement)& elem = itME.Value();
86 nbnodes = elem->NbNodes();
88 for (inode = 1; inode <= nbnodes; ++inode) {
89 const Handle(SMDS_MeshNode)& node = myMesh->GetNode(inode,elem);
90 if (mapnode.Add(node->GetID())) {
91 gp_Pnt P = node->Pnt();