View Issue Details

IDProjectCategoryView StatusLast Update
0027142Open CASCADEOCCT:Data Exchangepublic2023-03-19 22:32
ReporterabaAssigned Toaba 
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Product Version7.0.0 
Target Version7.7.0Fixed in Version7.7.0 
Summary0027142: Data Exchange - add possibility to set location in XCAFDoc_ShapeTool interface
DescriptionIt is supposed to add possibility to change XCAFDoc_Location attribute with XCAFDoc_ShapeTool.
Steps To ReproduceIt's improvement
TagsNo tags attached.
Test case number

Activities

git

2016-02-08 14:48

administrator   ~0050476

Branch CR27142 has been created by aba.

SHA-1: 3993ccee30cbd7b4878c0cb8be4b7b4a863cedd9


Detailed log of new commits:

Author: aba
Date: Mon Feb 8 14:47:57 2016 +0300

    0027142: Data Exchange - add possibility to set location in XCAFDoc_ShapeTool interface

git

2022-10-06 17:53

administrator   ~0111418

Branch CR27142 has been updated forcibly by atereshi.

SHA-1: 56ba537e8dd46c8a3ea15241f0e618b72ac361c9

dpasukhi

2022-10-06 19:10

administrator   ~0111419

src / XCAFDoc / XCAFDoc_ShapeTool.hxx
//! Sets new location to the shape

This may lead to some misunderstanding, the following lines will suffice.
 src / XCAFDoc / XCAFDoc_ShapeTool.cxx
+  Standard_EXPORT Standard_Boolean SetLocation (const TDF_Label& theShapeLabel, const TopLoc_Location& theLoc, TDF_Label& theRefLabel);
 src / XCAFDoc / XCAFDoc_ShapeTool.cxx
+Standard_Boolean XCAFDoc_ShapeTool::SetLocation (const TDF_Label& theShapeLabel, const TopLoc_Location& theLoc, TDF_Label& theRefLabel)

Separate the parameters on each line.
+//=======================================================================
+// function : SetLocation
+// purpose  :
+//=======================================================================
+
+Standard_Boolean XCAFDoc_ShapeTool::SetLocation (const TDF_Label& theShapeLabel, const TopLoc_Location& theLoc, TDF_Label& theRefLabel)

Remove new line between description and method
src / XCAFDoc / XCAFDoc_ShapeTool.cxx
+  // if input label is reference -> just change the location attribute
+  // if input label is shape, and it is free -> create reference to the shape

What if I want to move assembly?
src / XDEDRAW / XDEDRAW_Shapes.cxx
+static Standard_Boolean parseXYZ (const char** theArgVec, gp_XYZ& thePnt)
+
+static Standard_Integer setLocation (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)

No method description(header) {function... purpose...}
+
+  di.Add ("XSetLocation", R"(
+Doc Label transformation [transformation ... ]
+Applies given complex transformation to the shape at Label from Document.
+The label may contain a reference to a shape, an assembly or simple shape.
+The assembly or simple shape should not be referred by any reference.
+Transformations:
+  '-move x y z'                     - move shape
+  '-rotate x y z dx dy dz angle'    - rotate shape
+  '-scale [x y z] factor'           - scale shape
+Transformations are applied from left to right.
+There can be more than one transformation of the same type.
+At least one transformation must be specified.
+)"
+          __FILE__, setLocation, g);

Please heal the style and syntax.
+)"
+          __FILE__,

Need to add ',' between FILE and end of the string.
const TCollection_AsciiString anXYZ

Incorrect name, use aXYS; I think this variable is not needed, theArgVec[0], theArgVec[1], theArgVec[2] is enoungt.
+  if (!anXYZ[0].IsRealValue (Standard_True)
+  || !anXYZ[1].IsRealValue (Standard_True)
+  || !anXYZ[2].IsRealValue (Standard_True))
+  {
+    return Standard_False;
+  }

No message info
+    Message::SendFail() << "Error: not enough arguments, see help " << theArgVec[0] << " for details\n";
+    Message::SendFail() << "Error: " << theArgVec[1] << " is not a document\n";
+    Message::SendFail() << "Error: no such Label: " << theArgVec[2] << "\n";

Do not use '\n\ with Message in the end of the message.

What about matrix? if I want use XGetLocation and get string of matrix transformation?

+    if (aShapeLabel == aRefLabel)
+    {
+      Message::SendInfo() << "New location was set";
+    }
+    else
+    {
+      TCollection_AsciiString aLabelStr;
+      TDF_Tool::Entry(aRefLabel, aLabelStr);
+      Message::SendInfo() << "Reference to the shape at label " << aLabelStr << " was created and location was set";
+    }

For this messages we need special flag. For example, "silent" of something else.

git

2022-10-12 12:08

administrator   ~0111520

Branch CR27142 has been updated forcibly by atereshi.

SHA-1: 508957a5800963a75e82778ac8ab980b894fbd55

atereshi

2022-10-12 12:24

developer   ~0111521

Last edited: 2022-10-12 13:20

@dpasukhi
Dmitry, your comments are taken into account.

Transformations are limited to simple actions that are obvious to the user: moving, rotating, scaling.
The raw transformation matrix is not obvious to the DRAW user.
We can set the location to the assembly if the assembly is a free shape (i.e. it hasn't reference to itself).

gka

2022-10-19 17:42

developer   ~0111674

Branch CR27142 has been reviewed

git

2022-10-31 19:13

administrator   ~0111809

Branch CR27142 has been updated by atereshi.

SHA-1: ca443330ea5a150ade5892146f0a8706191b9ba7


Detailed log of new commits:

Author: atereshi
Date: Mon Oct 31 19:12:52 2022 +0300

    # fix warning

git

2022-11-02 13:52

administrator   ~0111844

Branch CR27142 has been deleted by mnt.

SHA-1: ca443330ea5a150ade5892146f0a8706191b9ba7

Related Changesets

occt: master f8d4cfbb

2016-02-08 14:47:57

aba


Committer: smoskvin Details Diff
0027142: Data Exchange - add possibility to set location in XCAFDoc_ShapeTool interface Affected Issues
0027142
mod - src/XCAFDoc/XCAFDoc_ShapeTool.cxx Diff File
mod - src/XCAFDoc/XCAFDoc_ShapeTool.hxx Diff File
mod - src/XDEDRAW/XDEDRAW_Shapes.cxx Diff File
add - tests/bugs/xde/bug27142 Diff File

Issue History

Date Modified Username Field Change
2016-02-08 14:46 aba New Issue
2016-02-08 14:46 aba Assigned To => gka
2016-02-08 14:48 git Note Added: 0050476
2016-10-26 11:52 gka Target Version 7.1.0 => 7.2.0
2017-07-27 09:24 abv Target Version 7.2.0 => 7.4.0
2019-09-04 12:58 abv Target Version 7.4.0 => 7.5.0
2020-09-17 19:52 gka Target Version 7.5.0 => 7.6.0
2021-10-07 12:34 szy Target Version 7.6.0 => 7.7.0
2022-09-12 10:00 gka Assigned To gka => atereshi
2022-10-06 17:53 git Note Added: 0111418
2022-10-06 17:56 atereshi Assigned To atereshi => gka
2022-10-06 17:56 atereshi Status new => resolved
2022-10-06 17:56 atereshi Steps to Reproduce Updated
2022-10-06 19:10 dpasukhi Note Added: 0111419
2022-10-12 12:08 git Note Added: 0111520
2022-10-12 12:24 atereshi Note Added: 0111521
2022-10-12 13:20 atereshi Note Edited: 0111521
2022-10-19 17:42 gka Assigned To gka => bugmaster
2022-10-19 17:42 gka Status resolved => reviewed
2022-10-19 17:42 gka Note Added: 0111674
2022-10-31 19:13 git Note Added: 0111809
2022-11-02 13:39 smoskvin Status reviewed => tested
2022-11-02 13:46 smoskvin Changeset attached => occt master f8d4cfbb
2022-11-02 13:46 aba Assigned To bugmaster => aba
2022-11-02 13:46 aba Status tested => verified
2022-11-02 13:46 aba Resolution open => fixed
2022-11-02 13:52 git Note Added: 0111844
2023-03-19 22:32 vglukhik Status verified => closed
2023-03-19 22:32 vglukhik Fixed in Version => 7.7.0