Error no standard conversion of SoCoordinate3* to SoNode*

Error no standard conversion of SoCoordinate3* to SoNode*

Post by Gurinder Singh Dhill » Fri, 17 Mar 1995 17:24:32



        I am writing a simple scene for QuadMesh generation

It is something like this in short

        SoSeparator *calc_surf = new SoSeparator;
        calc_surf->ref();
        SoCoordinate3 *input_Coord = new SoCoordinate3;
        input_Coord->point.setValues(0,dpts_u*dpts_v,comp_surf);
        calc_surf->addChild(input_Coord);
        SoQuadMesh *inputMesh = new SoQuadMesh;
        inputMesh->verticesPerRow = dpts_v;
        inputMesh->verticesPerColumn = dpts_u;
        calc_surf->addChild(inputMesh);

        When I run this I get the error

        no standard conversion of SoCoordinate3* to SoNode*

     on line   calc_surf->addChild(input_Coord);

        In case I do

        calc_surf->addChild((SoNode *)input_Coord);

        I get Segmentation fault or sometimes BusError or Killed

Can Someone please tell me what is going wrong here.

This is very simple and even is on the example but I cannot get over it.

Thanks

Gurinder

 
 
 

Error no standard conversion of SoCoordinate3* to SoNode*

Post by Bruce Bail » Sat, 18 Mar 1995 00:31:04




|>   I am writing a simple scene for QuadMesh generation
|>
|>
|> It is something like this in short
|>
|>
|>   SoSeparator *calc_surf = new SoSeparator;
|>   calc_surf->ref();
|>   SoCoordinate3 *input_Coord = new SoCoordinate3;
|>   input_Coord->point.setValues(0,dpts_u*dpts_v,comp_surf);
|>   calc_surf->addChild(input_Coord);
|>           SoQuadMesh *inputMesh = new SoQuadMesh;
|>   inputMesh->verticesPerRow = dpts_v;
|>   inputMesh->verticesPerColumn = dpts_u;
|>   calc_surf->addChild(inputMesh);
|>  
|>
|>   When I run this I get the error
|>
|>   no standard conversion of SoCoordinate3* to SoNode*
|>
|>      on line   calc_surf->addChild(input_Coord);
|>
|>
|>
|>   In case I do
|>
|>   calc_surf->addChild((SoNode *)input_Coord);
|>
|>
|>   I get Segmentation fault or sometimes BusError or Killed

this does not happen to me with the following example program:

// main.c++
#include <Inventor/SoDB.h>

#include <Inventor/nodes/SoCoordinate3.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoQuadMesh.h>

static float comp_surf[4][3] = {
   { 0, 0, 1}, { 1, 0, 1}, { 1, 8, 1}, { 0, 8, 1}

Quote:};

void main(int, char **argv) {

        SoDB::init();

        SoSeparator *calc_surf = new SoSeparator;
        calc_surf->ref();
        SoCoordinate3 *input_Coord = new SoCoordinate3;
        input_Coord->point.setValues(0,2*2,comp_surf);
        calc_surf->addChild(input_Coord);
        SoQuadMesh *inputMesh = new SoQuadMesh;
        inputMesh->verticesPerRow = 2;
        inputMesh->verticesPerColumn = 2;
        calc_surf->addChild(inputMesh);

Quote:}

% CC -g -o main main.c++ -lInventorXt

Can you post your entire program (if it isn't too big?)

-------------------------------------------------------------------

Systems Engineer                     tel: (303) 796-0022
Silicon Graphics                     fax: (303) 796-0438
4600 South Ulster Street, #820       vmail box:   5-8403
Denver, CO  80237
-------------------------------------------------------------------

 
 
 

Error no standard conversion of SoCoordinate3* to SoNode*

Post by Paul S. Strau » Sat, 18 Mar 1995 06:00:49



|>   I am writing a simple scene for QuadMesh generation
|>
|>
|> It is something like this in short
|>
|>
|>   SoSeparator *calc_surf = new SoSeparator;
|>   calc_surf->ref();
|>   SoCoordinate3 *input_Coord = new SoCoordinate3;
|>   input_Coord->point.setValues(0,dpts_u*dpts_v,comp_surf);
|>   calc_surf->addChild(input_Coord);
|>           SoQuadMesh *inputMesh = new SoQuadMesh;
|>   inputMesh->verticesPerRow = dpts_v;
|>   inputMesh->verticesPerColumn = dpts_u;
|>   calc_surf->addChild(inputMesh);
|>  
|>
|>   When I run this I get the error
|>
|>   no standard conversion of SoCoordinate3* to SoNode*

Are you #including SoCoordinate3.h?

----

  Open Inventor Web info in http://www.sgi.com/tech/Inventor.html

 
 
 

1. Segmentation Violation Errors With SoIndexedTriangleStripSet and SoCoordinate3

Hi,

I did some OpenInventor hacking at one site.  When I moved to another
site I got unexpected segmentation violation errors.

The get rid of the SoCoordinate3 error I added this line:

coords->point.setNum(mLen);

where mLen is the number of points I add to the SoCoordinate3 object
called coords.  Does anyone know why this fixed the error and why it
didn't happen before?

Also, I'm getting the same kind of error with SoIndexedTriangleStripSet
and I don't know how to fix it, especially since I don't know ahead of
time how many triangles I am going to create.  When I reach index 8 of
the TriangleStripSet I get the segmentation violation error when I do:

   indices->setValues(curr_index, 4, vertices);

Does anybody know how I can get rid of this?  I am quite stumped.  A
more complete listing of the code fragment where the error occurs is
below:

   SoCoordinate3 *mCoords;
   SoIndexedTriangleStripSet *mFaces;

   // adds indexes u,v,w,-1 into the SoIndexedTriangleFaceStripSet
   SoMFLong *indices = &(mFaces->coordIndex);
   int curr_index = indices->getNum();

   long vertices[4];
   vertices[0] = u;
   vertices[1] = v;
   vertices[2] = w;
   vertices[3] = -1;

   cout << "Pair::addTriangle().  Current Index is: " << curr_index << endl;
   indices->setValues(curr_index, 4, vertices);

Any help would be MOST appreciated.

Sincerely,
--

Later, Frank Kim   121 Sciarappa St #3, Cambridge, MA   02141-2121
                   http://cag-www.lcs.mit.edu/~frankkim/

2. Does Darktree Textures 1.0 worth buying?

3. CONVERSION OF CADKEY *.SLD FILES INTO STANDARD FORMATS

4. multiple projections, any ideas?

5. SoXtClipBoard and SoNode::copy() Iv2.0 question

6. Stream 0 does not have required number of vertices

7. Disabling SoNode::copy() or SoType::createInstance()

8. Motif and Doublebuffering

9. How to change SoCoordinate3

10. Adding same SoNode several times screws up Material...

11. Newbie: how to get coordinates of SoNode object?

12. SoNode Question

13. SoCoordinate3 and Engines