View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0027142 | Open CASCADE | OCCT:Data Exchange | public | 2016-02-08 14:46 | 2023-03-19 22:32 |
Reporter | Assigned To | ||||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Product Version | 7.0.0 | ||||
Target Version | 7.7.0 | Fixed in Version | 7.7.0 | ||
Summary | 0027142: Data Exchange - add possibility to set location in XCAFDoc_ShapeTool interface | ||||
Description | It is supposed to add possibility to change XCAFDoc_Location attribute with XCAFDoc_ShapeTool. | ||||
Steps To Reproduce | It's improvement | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
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 |
|
Branch CR27142 has been updated forcibly by atereshi. SHA-1: 56ba537e8dd46c8a3ea15241f0e618b72ac361c9 |
|
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. |
|
Branch CR27142 has been updated forcibly by atereshi. SHA-1: 508957a5800963a75e82778ac8ab980b894fbd55 |
|
@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). |
|
Branch CR27142 has been reviewed |
|
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 |
|
Branch CR27142 has been deleted by mnt. SHA-1: ca443330ea5a150ade5892146f0a8706191b9ba7 |
occt: master f8d4cfbb 2016-02-08 14:47:57
Committer: |
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 |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-02-08 14:46 |
|
New Issue | |
2016-02-08 14:46 |
|
Assigned To | => gka |
2016-02-08 14:48 | git | Note Added: 0050476 | |
2016-10-26 11:52 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-27 09:24 |
|
Target Version | 7.2.0 => 7.4.0 |
2019-09-04 12:58 |
|
Target Version | 7.4.0 => 7.5.0 |
2020-09-17 19:52 |
|
Target Version | 7.5.0 => 7.6.0 |
2021-10-07 12:34 |
|
Target Version | 7.6.0 => 7.7.0 |
2022-09-12 10:00 |
|
Assigned To | gka => atereshi |
2022-10-06 17:53 | git | Note Added: 0111418 | |
2022-10-06 17:56 |
|
Assigned To | atereshi => gka |
2022-10-06 17:56 |
|
Status | new => resolved |
2022-10-06 17:56 |
|
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 |
|
Note Added: 0111521 | |
2022-10-12 13:20 |
|
Note Edited: 0111521 | |
2022-10-19 17:42 |
|
Assigned To | gka => bugmaster |
2022-10-19 17:42 |
|
Status | resolved => reviewed |
2022-10-19 17:42 |
|
Note Added: 0111674 | |
2022-10-31 19:13 | git | Note Added: 0111809 | |
2022-11-02 13:39 |
|
Status | reviewed => tested |
2022-11-02 13:46 |
|
Changeset attached | => occt master f8d4cfbb |
2022-11-02 13:46 |
|
Assigned To | bugmaster => aba |
2022-11-02 13:46 |
|
Status | tested => verified |
2022-11-02 13:46 |
|
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 |