Some graphics are missing if return true from _ProduceGPAs() always.

All,

I am trying to process the extended elements and get the geometry details. Are there any specific steps to follow while returning true or false from   _ProduceGPAs(bool isCurved), _ProduceFacets(bool isIndexedPoly)  and _ProduceBodies(bool isCurved, int kernelType) or it is upto the developer. If I hardcode the return value of _ProduceGPAs to true, some graphics are missing in my application's display. Please help me on this.

Regards,

Pasu

  • Unknown said:
    Are there any specific steps to follow while returning true or false from   _ProduceXxx?

    Your class that inherits from Bentley::Ustn::IElementGraphicsProcessor should return True if you want the callbacks to be invoked by Bentley::Ustn::ElementGraphicsOutput::Process (..., yourClassInstance);

    Unknown said:
    If I hardcode the return value of _ProduceGPAs to true, some graphics are missing

    You have a choice of several types of graphics, of which GPAs is but one.  Not all objects may be represented by a particular type of renderer, although I think that facets (_ProcessFacetSet) will reproduce most objects.

     
    Regards, Jon Summers
    LA Solutions

  • A gpa can represent the following:

    Line
    Line String
    Shape
    Arc
    Ellipse
    Curve
    BSpline Curve
    Complex Chain
    Complex Shape
    Grouped Hole

    For geometry that isn't an open path or planar region you'll need to process it as a bspline surface, facets, or brep. If you return false from _ProduceFacets and _ProduceBodies most surface/solid types will be output as gpas...but it's just "wire" edges with no surface information...

    HTH



  • Brien,

    Please find my code below:              

                   virtual bool            _ProduceGPAs (bool isCurved) const override

    {

    return !isCurved;

    };

    virtual bool            _ProduceFacets (bool isIndexedPoly) const override

    {

    return isIndexedPoly;

    };

    virtual bool            _ProduceBodies (bool isCurved, int kernelType) const  override

    {

    if((kernelType== KERNEL_TYPE_PSOLID)||(kernelType== KERNEL_TYPE_ACIS))

    {

    return true;

    }

                           else

                                   return false;

    };

    I am using this code to process only extended elements.

    In _ProduceGPAs()/_ProduceFacets ()/_ProduceBodies() , I dont know whether it is a line or line_string or solid etc.. Then how can we decide whether to process it using kernals or facets or GPAs ?  

    Regards,

    Pasu

  • Good question, I'll try to explain.

    BReps are given highest priority. If _ProduceBodies returns true any solid or surface that can't be represented as a gpa (i.e. not a shape/complex shape, or parity region) will be output through _ProcessBody. The isCurved arg allows you to specify how to handle a surface or solid that only contains straight edges and planar faces, these can be represented exactly as facets, so it might be desirable to handle this as facets instead of creating a brep.

    Facets have precedence over "edges/gpas". If a surface or solid is rejected by _ProduceBodies and you return true for _ProduceFacets, it will be output through _ProcessFacetSet. The isIndexedPoly arg tells you whether the data was stored as facets, i.e. there will be no approximation to output the geometry through _ProcessFacetSet.

    A gpa will be used to represent open paths and regions as well as to output edges of surfaces/solids not handled by brep or facets. The isCurved arg will allow you to decide to output stroked geometry for planar regions and open paths when collecting facetted output.  When _ProduceFacets is true, closed shapes returned as a stroked polygon, open path as a stroked linestring.

    There are also some specific _Process method for cones, bspline surfaces, and bspline curves that will allow you to directly handle these types without having them converted to breps, facets, or gpas.

    So to collect the highest level geometry without approximation:

    _ProcessGPAs -> return true

    _ProduceFacets -> return isIndexedPoly

    _ProduceBodies -> return true

    Handle cones, bspline surfaces, and bspline curves directly by implementing _ProcessCone/_ProcessSurface/_ProcessCurve and return SUCCESS to avoid also having these processed as breps or facets.

    If you need to make geometry specific tests not handled by the basic criteria of the _Produce methods you do this in the _Process methods, i.e. do something special with a gpa that is a single arc, etc.

    HTH

    -B