View Issue Details

IDProjectCategoryView StatusLast Update
0022583Open CASCADEOCCT:Visualizationpublic2012-07-04 17:15
ReporteraplAssigned Tobugmaster  
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Target Version6.5.2Fixed in Version6.5.2 
Summary0022583: Graphic3d_ArrayOfPolygons is not displayed if it has both the bounds and edges
DescriptionThis type of primitive arrays suggests that the polygons can be defined with
a number of bounds and the number of edges per bound, but in that case the
polygons are not displayed.
  It is also necessary to implement DRAW command to check all of the existing
primitives array types.

The example code to reproduce the problem:

  // create an array
  Handle (Graphic3d_ArrayOfPolygons) anArray =
          new Graphic3d_ArrayOfPolygons (4, 2, 6, 0, 0, 0, 0);
  anArray->AddVertex (1.0, 1.0, 1.0);
  anArray->AddVertex (3.0, 1.0, 1.0);
  anArray->AddVertex (3.0, 3.0, 1.0);
  anArray->AddVertex (6.0, 3.0, 1.0);

  // define polygons
  anArray->AddBound (3);
  anArray->AddEdge (1);
  anArray->AddEdge (2);
  anArray->AddEdge (3);

  anArray->AddBound (3);
  anArray->AddEdge (2);
  anArray->AddEdge (3);
  anArray->AddEdge (4);

  // add polygons array to the presentation
  Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPrs);
  aGroup->BeginPrimitives ();
  aGroup->AddPrimitiveArray (anArray);
  aGroup->EndPrimitives ();

  // display
Additional information
and documentation updates
Changes:
Validity checking procedure for primitives array has been corrected. Now it passes arrays that are correct and have defined verticies, "bounds" and "edges" together.
Redundant logical blocks in Graphic3d_ArrayOfPrimitives::IsValid has been removed.
DRAW command "vdrawparray" has been added to test all types of primitives arrays. This command draws primitives array of defined type by its verticies, bounds, edges passed in form of a string as input arguments.

There are changes in the following packages:
Graphic3d package:
1) In method Graphic3d_ArrayOfPrimitives::IsValid() checking procedure corrected to correctly pass arrays with bounds and edges together.

ViewerTest package:
1) Draw command "vdrawparray" has been added to test primitive arrays building and display procedure.
TagsNo tags attached.
Test case numberchl 934 C2

Attached Files

  • test22583.tar.gz (2,837 bytes)

Activities

apl

2011-08-05 13:12

developer   ~0017919

SVN branch http://svn/svn/occt/branches/OCC22583 is ready to be reviewed.

bugmaster

2011-08-05 13:45

administrator   ~0017921

Kirill,

Please revise http://svn/svn/occt/branches/OCC22583

apl

2011-08-08 12:25

developer  

test22583.tar.gz (2,837 bytes)

san

2011-09-14 13:01

developer   ~0018150

SVN branch http://svn/svn/occt/branches/OCC22583 [^] reviewed without any remarks.

kgv

2011-09-14 13:33

developer   ~0018151

Last edited: 2011-09-14 13:34

>> // register the object in map
>> GetMapOfAIS().Bind (aPObject, aName);
will cause double-bind exception on second try (like BUG 0022522).
Maybe write common procedure in ViewerTest to replace displayed AIS object in viewer?

>> static int CheckElementCommand(...)
this function seems to be should return boolean value rather than magic 0 and 1.

>> // is argument list has an vbo flag
>> Standard_Boolean hasFlagVbo = Standard_False;
>> if (isdigit (argv[3][0]) && atoi (argv[3]) >= 0 && atoi (argv[3]) <= 1)
>> hasFlagVbo = Standard_True;
will be more clear like this:
  Standard_Boolean hasFlagVbo = (isdigit (argv[3][0]) && atoi (argv[3]) >= 0 && atoi (argv[3]) <= 1);

>> if (!aDriver.IsNull())
>> aDriver->EnableVBO ((hasFlagVbo) ? (Standard_Boolean) atoi (argv[3]) : Standard_True);
I think this code shouldn't change VBO state at all if hasFlagVbo is false. Isn't it?

apl

2011-09-15 11:51

developer   ~0018157

Dear bugmaster,

Remarks from KGV has been corrected
Applied to SVN branch http://svn/svn/occt/branches/OCC22583

apl

2011-09-15 11:56

developer   ~0018158

Dear Kirill,

I've added a new function in ViewerTest_ObjectCommands.cxx: RegisterInMapOfAIS; it binds input AIS object to the map of AIS and has options to handle old AIS object registered with same name (if there is one in map) - it can be kept without registering new object or simply replaced with removing it from AIS interactive context (otherwise, it is impossible to clear/erase such object in DRAW);

This function can be used elsewhere, for example, for BUG 0022522

kgv

2011-09-15 13:46

developer   ~0018163

Dear Bugmaster, the branch is ready for testing.

2apl, I slightly modified this new function (add display call, check AIS context for NULL, do not display object if registration in map was failed).

miv

2011-09-16 16:42

tester   ~0018194

Dear Bugmaster,

This fix tested.

Regression was not found.

bugmaster

2011-09-16 17:09

administrator   ~0018198

Integration into trunk of occt repository

Date: 2011-09-16 17:08:33 +0400 (Fri, 16 Sep 2011)
New Revision: 9053

Modified:
   trunk/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx
   trunk/src/ViewerTest/ViewerTest.cxx
   trunk/src/ViewerTest/ViewerTest_ObjectCommands.cxx

Related Changesets

occt: master 9558a876

2011-09-16 13:08:33

apl


Committer: bugmaster Details Diff
0022583: Graphic3d_ArrayOfPolygons is not displayed if it has both the bounds and edges Affected Issues
0022583
mod - src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx Diff File
mod - src/ViewerTest/ViewerTest.cxx Diff File
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx Diff File

Issue History

Date Modified Username Field Change
2011-07-26 16:13 bugmaster Assigned To bugmaster => apl
2011-07-26 16:13 bugmaster Status new => assigned
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2011-08-05 13:09 apl Fixed in Version EMPTY =>
2011-08-05 13:09 apl Description Updated
2011-08-05 13:09 apl Additional Information Updated
2011-08-05 13:12 apl Note Added: 0017919
2011-08-05 13:44 bugmaster Assigned To apl => kgv
2011-08-05 13:45 bugmaster Note Added: 0017921
2011-08-08 12:25 apl File Added: test22583.tar.gz
2011-09-14 13:01 san Note Added: 0018150
2011-09-14 13:01 san Status assigned => reviewed
2011-09-14 13:03 san Target Version => 6.5.2
2011-09-14 13:33 kgv Note Added: 0018151
2011-09-14 13:34 kgv Note Edited: 0018151
2011-09-14 13:36 kgv Assigned To kgv => apl
2011-09-14 16:55 mkv Status reviewed => assigned
2011-09-15 11:51 apl Note Added: 0018157
2011-09-15 11:51 apl Status assigned => resolved
2011-09-15 11:56 apl Note Added: 0018158
2011-09-15 13:46 kgv Note Added: 0018163
2011-09-15 13:46 kgv Assigned To apl => bugmaster
2011-09-15 13:46 kgv Status resolved => reviewed
2011-09-16 16:39 miv Test case number => chl 934 C2
2011-09-16 16:42 miv Note Added: 0018194
2011-09-16 16:42 miv Status reviewed => tested
2011-09-16 17:09 bugmaster Note Added: 0018198
2011-09-16 17:09 bugmaster Status tested => verified
2011-09-16 17:09 bugmaster Resolution open => fixed
2012-03-29 17:26 bugmaster Changeset attached => occt master 9558a876