[cgma-dev] r4790 - cgm/trunk/itaps

Tim Tautges tautges at mcs.anl.gov
Mon May 2 14:08:18 CDT 2011


Maybe I need to be a bit more specific in my request that Jane implement functions in iGeom to get facet information. 
The function signature I'm looking for is:

iGeom_getFacets(iGeom_EntityHandle entity,
                 double dist_tolerance,
                 double **points, int *points_alloc, int *points_size,
                 int **facets, int *facets_alloc, int *facets_size)

This should be a function that appears in iGeom.h, and is implemented in iGeom_CGMA.cc by calling functions in CGM.  I 
know the CGM RefFace function has more options, but I don't think we should expose those options in iGeom (or, at least, 
I don't know whether they're common enough across modeling engines, maybe you can investigate that too based on OCC).

- tim

On 05/02/2011 01:23 PM, Jason Kraftcheck wrote:
> Should we drop the general facet concept from Cubit and instead assume
> triangles?
>
> What use are these functions?  They just copy the data from the Cubit GMem
> object to DLILists.  Both are CGM-specific data structures.
>
> Why return a DLIList of pointers to dynamically allocated CubitVector
> instances?  Why not just a std::vector of CubitVectors?  Or an std::vector
> of floats if the extra precision isn't required.
>
> This loop (present in both functions) looks wrong:
>
>    for(int i = 0; i<  facets.facet_list_size(); i++)
>    {
>      facet_list.append(list[i]);
>      i++;
>    }
>
> - jason
>
>
> On 05/02/2011 01:08 PM, jiangtao_ma at yahoo.com wrote:
>> Author: janehu
>> Date: 2011-05-02 13:08:11 -0500 (Mon, 02 May 2011)
>> New Revision: 4790
>>
>> Modified:
>>     cgm/trunk/itaps/iGeom_CGMA.cc
>> Log:
>> Added iGeom function to pass out facet info for RefFaces and RefEdges.
>>
>> Modified: cgm/trunk/itaps/iGeom_CGMA.cc
>> ===================================================================
>> --- cgm/trunk/itaps/iGeom_CGMA.cc	2011-05-02 16:48:16 UTC (rev 4789)
>> +++ cgm/trunk/itaps/iGeom_CGMA.cc	2011-05-02 18:08:11 UTC (rev 4790)
>> @@ -22,7 +22,7 @@
>>    */
>>   #include "iGeom.h"
>>   #include "InitCGMA.hpp"
>> -
>> +#include "GMem.hpp"
>>   #include<iostream>
>>   #include<math.h>
>>   #include "GeometryQueryTool.hpp"
>> @@ -278,7 +278,20 @@
>>                               DLIList<RefEntity*>&  target_list,
>>                               int* err );
>>
>> +static
>> +CubitStatus iGeom_get_graphics(RefFace* face,
>> +                               DLIList<CubitVector*>&  point_list,
>> +                               DLIList<int>&  facet_list,
>> +                               unsigned short normal_tolerance = 15,
>> +                               double distance_tolerance = 0,
>> +                               double longest_edge = 0) ;
>>
>> +static
>> +CubitStatus iGeom_get_graphics(RefEdge* edge,
>> +                               DLIList<CubitVector*>&  point_list,
>> +                               DLIList<int>&  facet_list,
>> +                               double tolerance = 0.0 ) ;
>> +
>>   static CubitStatus init_cgm( const std::string&  engine )
>>   {
>>     CubitStatus status;
>> @@ -7049,3 +7062,66 @@
>>
>>     RETURN(iBase_SUCCESS);
>>   }
>> +
>> +static
>> +CubitStatus iGeom_get_graphics(RefFace* face,
>> +                               DLIList<CubitVector*>&  point_list,
>> +                               DLIList<int>&  facet_list,
>> +                               unsigned short normal_tolerance ,
>> +                               double distance_tolerance ,
>> +                               double longest_edge )
>> +{
>> +  GMem facets;
>> +  CubitStatus resl = face->get_graphics(facets,  normal_tolerance,
>> +                                        distance_tolerance, longest_edge);
>> +  if(resl == CUBIT_FAILURE)
>
>

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706



More information about the cgma-dev mailing list