[brlcad-commits] SF.net SVN: brlcad:[69400] brlcad/trunk/src/external/CREO
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2017-02-07 17:19:38
|
Revision: 69400 http://sourceforge.net/p/brlcad/code/69400 Author: starseeker Date: 2017-02-07 17:19:36 +0000 (Tue, 07 Feb 2017) Log Message: ----------- Start decomposing the creo-brl.cpp file into topic specific files. The idea will be to enable functionality gradually in stages. Added Paths: ----------- brlcad/trunk/src/external/CREO/assembly.cpp brlcad/trunk/src/external/CREO/creo-brl.h brlcad/trunk/src/external/CREO/csg.cpp brlcad/trunk/src/external/CREO/main.cpp brlcad/trunk/src/external/CREO/part.cpp brlcad/trunk/src/external/CREO/util.cpp Added: brlcad/trunk/src/external/CREO/assembly.cpp =================================================================== --- brlcad/trunk/src/external/CREO/assembly.cpp (rev 0) +++ brlcad/trunk/src/external/CREO/assembly.cpp 2017-02-07 17:19:36 UTC (rev 69400) @@ -0,0 +1,478 @@ +/* C R E O - B R L - I N I T . C P P + * BRL-CAD + * + * Copyright (c) 2017 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file creo-brl-init.cpp + * + */ + +#include "common.h" +#include "creo-brl.h" + +/* structure to hold info about a member of the current assembly + * this structure is created during feature visit + */ +struct asm_member { + ProCharName name; + ProMatrix xform; + ProMdlType type; + struct asm_member *next; +}; + +/* structure to hold info about current assembly + * members are added during feature visit + */ +struct asm_head { + ProCharName name; + ProMdl model; + struct asm_member *members; +}; + + + +/* routine that is called by feature visit for each assembly member + * the "app_data" is the head of the assembly info for this assembly + */ +extern "C" ProError +assembly_comp( ProFeature *feat, ProError status, ProAppData app_data ) +{ + ProIdTable id_table; + ProMdl model; + ProAsmcomppath comp_path; + ProMatrix xform; + ProMdlType type; + ProName name; + struct asm_head *curr_assem = (struct asm_head *)app_data; + struct asm_member *member, *prev=NULL; + int i, j; + + status = ProAsmcompMdlNameGet( feat, &type, name ); + if ( status != PRO_TK_NO_ERROR ) { + fprintf( stderr, "ProAsmcompMdlNameGet() failed\n" ); + return status; + } + (void)ProWstringToString( curr_part_name, name ); + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Processing assembly member %s\n", curr_part_name ); + } + + /* the next two Pro/Toolkit calls are the only way I could find to get + * the transformation matrix to apply to this member. + * this call is creating a path from the assembly to this particular member + * (assembly/member) + */ + id_table[0] = feat->id; + status = ProAsmcomppathInit( (ProSolid)curr_assem->model, id_table, 1, &comp_path ); + if ( status != PRO_TK_NO_ERROR ) { + snprintf( astr, sizeof(astr), "Failed to get path from %s to %s (aborting)", curr_asm_name, + curr_part_name ); + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", astr ); + ProMessageClear(); + fprintf( stderr, "%s\n", astr ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + return status; + } + + /* this call accumulates the xform matrix along the path created above */ + status = ProAsmcomppathTrfGet( &comp_path, PRO_B_TRUE, xform ); + if ( status != PRO_TK_NO_ERROR ) { + snprintf( astr, sizeof(astr), "Failed to get transformation matrix %s/%s, error = %d, id = %d", + curr_asm_name, curr_part_name, status, feat->id ); + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", astr ); + ProMessageClear(); + fprintf( stderr, "%s\n", astr ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + return PRO_TK_NO_ERROR; + } + + /* add this member to our assembly info */ + prev = NULL; + member = curr_assem->members; + if ( member ) { + while ( member->next ) { + prev = member; + member = member->next; + } + BU_ALLOC(member->next, struct asm_member); + prev = member; + member = member->next; + } else { + BU_ALLOC(curr_assem->members, struct asm_member); + member = curr_assem->members; + } + + if ( !member ) { + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", + "memory allocation for member failed" ); + ProMessageClear(); + fprintf( stderr, "memory allocation for member failed\n" ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + return PRO_TK_GENERAL_ERROR; + } + member->next = NULL; + + /* capture its name */ + (void)ProWstringToString( member->name, name ); + + /* copy xform matrix */ + for ( i=0; i<4; i++ ) { + for ( j=0; j<4; j++ ) { + member->xform[i][j] = xform[i][j]; + } + } + + /* get the model for this member */ + status = ProAsmcompMdlGet( feat, &model ); + if ( status != PRO_TK_NO_ERROR ) { + snprintf( astr, sizeof(astr), "Failed to get model for component %s", + curr_part_name ); + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", astr ); + ProMessageClear(); + fprintf( stderr, "%s\n", astr ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + return status; + } + + /* get its type (part or assembly are the only ones that should make it here) */ + status = ProMdlTypeGet( model, &type ); + if ( status != PRO_TK_NO_ERROR ) { + snprintf( astr, sizeof(astr), "Failed to get type for component %s", + curr_part_name ); + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", astr ); + ProMessageClear(); + fprintf( stderr, "%s\n", astr ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + return status; + } + + /* remember the type */ + member->type = type; + + /* output this member */ + switch ( type ) { + case PRO_MDL_ASSEMBLY: + output_assembly( model ); + break; + case PRO_MDL_PART: + if ( output_part( model ) == 2 ) { + /* part had no solid parts, eliminate from the assembly */ + if ( prev ) { + prev->next = NULL; + } else { + curr_assem->members = NULL; + } + bu_free( (char *)member, "asm member" ); + } + break; + } + + return PRO_TK_NO_ERROR; +} + +/* this routine is a filter for the feature visit routine + * selects only "component" items (should be only parts and assemblies) + */ +extern "C" ProError +assembly_filter( ProFeature *feat, ProAppData *data ) +{ + ProFeattype type; + ProFeatStatus feat_status; + ProError status; + + status = ProFeatureTypeGet( feat, &type ); + if ( status != PRO_TK_NO_ERROR ) { + sprintf( astr, "In assembly_filter, cannot get feature type for feature %d", + feat->id ); + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", astr ); + ProMessageClear(); + fprintf( stderr, "%s\n", astr ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + return PRO_TK_CONTINUE; + } + + if ( type != PRO_FEAT_COMPONENT ) { + return PRO_TK_CONTINUE; + } + + status = ProFeatureStatusGet( feat, &feat_status ); + if ( status != PRO_TK_NO_ERROR ) { + sprintf( astr, "In assembly_filter, cannot get feature status for feature %d", + feat->id ); + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", astr ); + ProMessageClear(); + fprintf( stderr, "%s\n", astr ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + return PRO_TK_CONTINUE; + } + + if ( feat_status != PRO_FEAT_ACTIVE ) { + return PRO_TK_CONTINUE; + } + + return PRO_TK_NO_ERROR; +} + + +/* routine to free the memory associated with our assembly info */ +extern "C" void +free_assem( struct asm_head *curr_assem ) +{ + struct asm_member *ptr, *tmp; + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Freeing assembly info\n" ); + } + + ptr = curr_assem->members; + while ( ptr ) { + tmp = ptr; + ptr = ptr->next; + bu_free( (char *)tmp, "asm member" ); + } +} + +/* routine to list assembly info (for debugging) */ +extern "C" void +list_assem( struct asm_head *curr_asm ) +{ + struct asm_member *ptr; + + fprintf( stderr, "Assembly %s:\n", curr_asm->name ); + ptr = curr_asm->members; + while ( ptr ) { + fprintf( stderr, "\t%s\n", ptr->name ); + ptr = ptr->next; + } +} + +/* routine to output an assembly as a BRL-CAD combination + * The combination will have the Pro/E name with a ".c" suffix. + * Cannot just use the Pro/E name, because assembly can have the same name as a part. + */ +extern "C" void +output_assembly( ProMdl model ) +{ + ProName asm_name; + ProMassProperty mass_prop; + ProError status; + ProBoolean is_exploded; + struct asm_head curr_assem; + struct asm_member *member; + int member_count=0; + int i, j, k; + int ret_status=0; + + if ( ProMdlNameGet( model, asm_name ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get model name for an assembly\n" ); + return; + } + + /* do not output this assembly more than once */ + if ( already_done_asm( asm_name ) ) + return; + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Processing assembly %s:\n", ProWstringToString( astr, asm_name ) ); + } + + /* let the user know we are doing something */ + + status = ProUILabelTextSet( "creo_brl", "curr_proc", asm_name ); + if ( status != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to update dialog label for currently processed assembly\n" ); + return; + } +#if 0 + status = ProUIDialogActivate( "creo_brl", &ret_status ); + if ( status != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Error in creo-brl Dialog, error = %d\n", + status ); + fprintf( stderr, "\t dialog returned %d\n", ret_status ); + } +#endif + +bu_log("got here\n"); + /* everything starts out in "curr_part_name", copy name to "curr_asm_name" */ + bu_strlcpy( curr_asm_name, curr_part_name, sizeof(curr_asm_name) ); + + /* start filling in assembly info */ + bu_strlcpy( curr_assem.name, curr_part_name, sizeof(curr_assem.name) ); + curr_assem.members = NULL; + curr_assem.model = model; + + /* make sure this assembly is not "exploded"!!! + * some careless designers leave assemblies in exploded mode + */ +#if 0 + status = ProAssemblyIsExploded(*(ProAssembly *)model, &is_exploded ); + if ( status != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get explode status of %s\n", curr_assem.name ); + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Failed to get explode status of %s\n", curr_assem.name ); + } + } + + if ( is_exploded ) { + /* unexplode this assembly !!!! */ + status = ProAssemblyUnexplode(*(ProAssembly *)model ); + if ( status != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to un-explode assembly %s\n", curr_assem.name ); + fprintf( stderr, "\tcomponents will be incorrectly positioned\n" ); + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Failed to un-explode assembly %s\n", curr_assem.name ); + fprintf( logger, "\tcomponents will be incorrectly positioned\n" ); + } + } + } +#endif + + /* use feature visit to get info about assembly members. + * also calls output functions for members (parts or assemblies) + */ + status = ProSolidFeatVisit( ProMdlToPart(model), + assembly_comp, + (ProFeatureFilterAction)assembly_filter, + (ProAppData)&curr_assem ); + + /* output the accumulated assembly info */ + fprintf( outfp, "put {%s.c} comb region no tree ", get_brlcad_name( curr_assem.name ) ); + + /* count number of members */ + member = curr_assem.members; + while ( member ) { + member_count++; + member = member->next; + } + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Output %d members of assembly\n", member_count ); + } + + /* output the "tree" */ + for ( i=1; i<member_count; i++ ) { + fprintf( outfp, "{u "); + } + + member = curr_assem.members; + i = 0; + while ( member ) { + /* output the member name */ + if ( member->type == PRO_MDL_ASSEMBLY ) { + fprintf( outfp, "{l {%s.c}", get_brlcad_name( member->name ) ); + } else { + fprintf( outfp, "{l {%s}", get_brlcad_name( member->name ) ); + } + + /* if there is an xform matrix, put it here */ + if ( is_non_identity( member->xform ) ) { + fprintf( outfp, " {" ); + for ( j=0; j<4; j++ ) { + for ( k=0; k<4; k++ ) { + if ( k == 3 && j < 3 ) { + fprintf( outfp, " %.12e", + member->xform[k][j] * creo_to_brl_conv ); + } else { + fprintf( outfp, " %.12e", + member->xform[k][j] ); + } + } + } + fprintf( outfp, "}" ); + } + if ( i ) { + fprintf( outfp, "}} " ); + } else { + fprintf( outfp, "} " ); + } + member = member->next; + i++; + } + fprintf( outfp, "\n" ); + + fprintf( outfp, "attr set {%s.c} %s %s\n", + get_brlcad_name( curr_assem.name ), + CREO_NAME_ATTR, + curr_assem.name ); + + /* calculate mass properties */ + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Getting mass properties for this assembly\n" ); + } + + status = ProSolidMassPropertyGet( ProMdlToSolid( model ), NULL, &mass_prop ); + if ( status == PRO_TK_NO_ERROR ) { + if ( mass_prop.density > 0.0 ) { + fprintf( outfp, "attr set {%s.c} density %g\n", + get_brlcad_name( curr_assem.name ), + mass_prop.density ); + } + if ( mass_prop.mass > 0.0 ) { + fprintf( outfp, "attr set {%s.c} mass %g\n", + get_brlcad_name( curr_assem.name ), + mass_prop.mass ); + } + if ( mass_prop.volume > 0.0 ) { + fprintf( outfp, "attr set {%s.c} volume %g\n", + get_brlcad_name( curr_assem.name ), + mass_prop.volume ); + } + } + + /* add this assembly to the list of already output objects */ + add_to_done_asm( asm_name ); + + /* free the memory associated with this assembly */ + free_assem( &curr_assem ); +} + +extern "C" void +add_to_done_asm( wchar_t *name ) +{ + wchar_t *name_copy; + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Added %s to list of done assemblies\n", ProWstringToString( astr, name ) ); + } + + if (done_list_asm.find(name) == done_list_part.end()) { + name_copy = ( wchar_t *)bu_calloc( wcslen( name ) + 1, sizeof( wchar_t ), + "asm name for done list" ); + wcsncpy( name_copy, name, wcslen(name)+1 ); + done_list_asm.insert(name_copy); + } +} + +extern "C" int +already_done_asm( wchar_t *name ) +{ + if (done_list_asm.find(name) != done_list_asm.end()) { + return 1; + } + return 0; +} + + +/* + * Local Variables: + * mode: C + * tab-width: 8 + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Property changes on: brlcad/trunk/src/external/CREO/assembly.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: brlcad/trunk/src/external/CREO/creo-brl.h =================================================================== --- brlcad/trunk/src/external/CREO/creo-brl.h (rev 0) +++ brlcad/trunk/src/external/CREO/creo-brl.h 2017-02-07 17:19:36 UTC (rev 69400) @@ -0,0 +1,221 @@ +/* C R E O - B R L . H + * BRL-CAD + * + * Copyright (c) 2017 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file creo-brl.h + * + */ + +#include "common.h" + +#include <set> + +#ifndef _WSTUDIO_DEFINED +# define _WSTUDIO_DEFINED +#endif +extern "C" { +#include <ProToolkit.h> +#include <ProArray.h> +#include <ProAsmcomppath.h> +#include <ProAssembly.h> +#include <ProFaminstance.h> +#include <ProFeatType.h> +#include <ProHole.h> +#include <ProMdl.h> +#include <ProMdlUnits.h> +#include <ProMenuBar.h> +#include <ProMessage.h> +#include <ProMode.h> +#include <ProNotify.h> +#include <ProPart.h> +#include <ProSkeleton.h> +#include <ProSolid.h> +#include <ProSurface.h> +#include <ProUICheckbutton.h> +#include <ProUICmd.h> +#include <ProUIDialog.h> +#include <ProUIInputpanel.h> +#include <ProUILabel.h> +#include <ProUIMessage.h> +#include <ProUIPushbutton.h> +#include <ProUIRadiogroup.h> +#include <ProUITextarea.h> +#include <ProUtil.h> +#include <ProWindows.h> +#include <PtApplsUnicodeUtils.h> +#include <pd_proto.h> + +#include "vmath.h" +#include "bu.h" +#include "bn.h" +} + +struct StrCmp { + bool operator()(struct bu_vls *str1, struct bu_vls *str2) const { + return (bu_strcmp(bu_vls_addr(str1), bu_vls_addr(str2)) < 0); + } +}; + + +struct WStrCmp { + bool operator()(wchar_t *str1, wchar_t *str2) const { + return (wcscmp(str1, str2) < 0); + } +}; + +extern "C" { +int is_non_identity(ProMatrix xform); + +static wchar_t MSGFIL[] = {'c', 'r', 'e', 'o', '-', 'b', 'r', 'l', '-', 'm', 's', 'g', '.', 't', 'x', 't', '\0'}; + +static double creo_to_brl_conv=25.4; /* inches to mm */ + +static ProBool do_facets_only; /* flag to indicate no CSG should be done */ +static ProBool get_normals; /* flag to indicate surface normals should be extracted from geometry */ +static ProBool do_elims; /* flag to indicate that small features are to be eliminated */ +static double max_error=1.5; /* (mm) maximum allowable error in facetized approximation */ +static double min_error=1.5; /* (mm) maximum allowable error in facetized approximation */ +static double tol_dist=0.0005; /* (mm) minimum distance between two distinct vertices */ +static double max_angle_cntrl=0.5; /* max angle control for tessellation ( 0.0 - 1.0 ) */ +static double min_angle_cntrl=0.5; /* min angle control for tessellation ( 0.0 - 1.0 ) */ +static int max_to_min_steps = 1; /* number of steps between max and min */ +static double error_increment=0.0; +static double angle_increment=0.0; +static double local_tol=0.0; /* tolerance in Pro/E units */ +static double local_tol_sq=0.0; /* tolerance squared */ +static double min_hole_diameter=0.0; /* if > 0.0, all holes features smaller than this will be deleted */ +static double min_chamfer_dim=0.0; /* if > 0.0, all chamfers with both dimensions less + * than this value will be deleted */ +static double min_round_radius=0.0; /* if > 0.0, all rounds with radius less than this + * value will be deleted */ +static int *feat_ids_to_delete=NULL; /* list of hole features to delete */ +static int feat_id_len=0; /* number of available slots in the above array */ +static int feat_id_count=0; /* number of hole features actually in the above list */ +#define FEAT_ID_BLOCK 64 /* number of slots to allocate in above list */ + +static struct bu_hash_tbl *name_hash; +#define NUM_HASH_TABLE_BINS 4096 /* number of bins for part number to part name hash table */ + +static int reg_id = 1000; /* region ident number (incremented with each part) */ + +static struct vert_root *vert_tree_root; /* structure for storing and searching on vertices */ +static struct vert_root *norm_tree_root; /* structure for storing and searching on normals */ + +static ProTriangle *part_tris=NULL; /* list of triangles for current part */ +static int max_tri=0; /* number of triangles currently malloced */ +static int curr_tri=0; /* number of triangles currently being used */ + +#define TRI_BLOCK 512 /* number of triangles to malloc per call */ + +static int *part_norms=NULL; /* list of indices into normals (matches part_tris) */ + +static FILE *outfp=NULL; /* output file */ + +static FILE *logger=NULL; /* log file */ + +#define LOGGER_TYPE_NONE -1 +#define LOGGER_TYPE_FAILURE 0 +#define LOGGER_TYPE_SUCCESS 1 +#define LOGGER_TYPE_FAILURE_OR_SUCCESS 2 +#define LOGGER_TYPE_ALL 3 + +static int logger_type = LOGGER_TYPE_NONE; + +static ProCharName curr_part_name; /* current part name */ +static ProCharName curr_asm_name; /* current assembly name */ +static ProFeattype curr_feat_type; /* current feature type */ + +static struct bu_ptbl search_path_list; /* parsed list of search path directories */ +static ProName assem_ext; /* "asm" */ +static ProName part_ext; /* "prt" */ + +static ProCharLine astr; /* buffer for Pro/E output messages */ + +#define DONE_BLOCK 512 /* number of slots to malloc when above array gets full */ + +#define COPY_BUFFER_SIZE 1024 + +/* global variables for dimension visits */ +static double radius=0.0, diameter=0.0, distance1=0.0, distance2=0.0; +static int got_diameter=0, got_distance1=0; +static int hole_type; +static int add_cbore; +static int add_csink; +static int hole_depth_type; + +static double cb_depth=0.0; /* counter-bore depth */ +static double cb_diam=0.0; /* counter-bore diam */ +static double cs_diam=0.0; /* counter-sink diam */ +static double cs_angle=0.0; /* counter-sink angle */ +static double hole_diam=0.0; /* drilled hle diameter */ +static double hole_depth=0.0; /* drilled hole depth */ +static double drill_angle=0.0; /* drill tip angle */ +#define MIN_RADIUS 1.0e-7 /* BRL-CAD does not allow tgc's with zero radius */ +static Pro3dPnt end1, end2; /* axis endpoints for holes */ +std::set<wchar_t *, WStrCmp> done_list_part; /* list of parts already done */ +std::set<wchar_t *, WStrCmp> done_list_asm; /* list of assemblies already done */ +std::set<struct bu_vls *, StrCmp> brlcad_names; /* BRL-CAD names in use */ + +/* declaration of functions passed to the feature visit routine */ +static ProError assembly_comp( ProFeature *feat, ProError status, ProAppData app_data ); +static ProError assembly_filter( ProFeature *feat, ProAppData *data ); + +struct empty_parts { + char *name; + struct empty_parts *next; +}; + +static struct empty_parts *empty_parts_root=NULL; + +#define NUM_OBJ_TYPES 629 +int obj_type_count[NUM_OBJ_TYPES]; +char *obj_type[NUM_OBJ_TYPES]; + +#define NUM_FEAT_TYPES 314 +#define FEAT_TYPE_OFFSET 910 +int feat_type_count[NUM_FEAT_TYPES]; +char *feat_type[NUM_FEAT_TYPES]; + +#define MAX_LINE_LEN 256 /* maximum allowed line length for part number to name map file */ +#define CREO_NAME_ATTR "CREO_Name" + +static char *feat_status[]={ + "PRO_FEAT_ACTIVE", + "PRO_FEAT_INACTIVE", + "PRO_FEAT_FAMTAB_SUPPRESSED", + "PRO_FEAT_SIMP_REP_SUPPRESSED", + "PRO_FEAT_PROG_SUPPRESSED", + "PRO_FEAT_SUPPRESSED", + "PRO_FEAT_UNREGENERATED" +}; + +} + + +extern "C" void doit(char *dialog, char *compnent, ProAppData appdata); +extern "C" void do_quit(char *dialog, char *compnent, ProAppData appdata); + +/* + * Local Variables: + * mode: C + * tab-width: 8 + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Property changes on: brlcad/trunk/src/external/CREO/creo-brl.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: brlcad/trunk/src/external/CREO/csg.cpp =================================================================== --- brlcad/trunk/src/external/CREO/csg.cpp (rev 0) +++ brlcad/trunk/src/external/CREO/csg.cpp 2017-02-07 17:19:36 UTC (rev 69400) @@ -0,0 +1,875 @@ +/* C S G . C P P + * BRL-CAD + * + * Copyright (c) 2017 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file csg.cpp + * + */ + +#include "common.h" +#include "creo-brl.h" + +/* structure to hold info about CSG operations for current part */ +struct csg_ops { + char op; + struct bu_vls name; + struct bu_vls dbput; + struct csg_ops *next; +}; + +struct csg_ops *csg_root; +static int hole_no=0; /* hole counter for unique names */ +static char *tgc_format="tgc V {%.25G %.25G %.25G} H {%.25G %.25G %.25G} A {%.25G %.25G %.25G} B {%.25G %.25G %.25G} C {%.25G %.25G %.25G} D {%.25G %.25G %.25G}\n"; + +/* routine to free the list of CSG operations */ +extern "C" void +free_csg_ops() +{ + struct csg_ops *ptr1, *ptr2; + + ptr1 = csg_root; + + while ( ptr1 ) { + ptr2 = ptr1->next; + bu_vls_free( &ptr1->name ); + bu_vls_free( &ptr1->dbput ); + bu_free( ptr1, "csg op" ); + ptr1 = ptr2; + } + + csg_root = NULL; +} + + +extern "C" void +Add_to_feature_delete_list( int id ) +{ + if ( feat_id_count >= feat_id_len ) { + feat_id_len += FEAT_ID_BLOCK; + feat_ids_to_delete = (int *)bu_realloc( (char *)feat_ids_to_delete, + feat_id_len * sizeof( int ), + "feature ids to delete"); + + } + feat_ids_to_delete[feat_id_count++] = id; + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Adding feature %d to list of features to delete (list length = %d)\n", + id, feat_id_count ); + } +} + +extern "C" ProError +geomitem_visit( ProGeomitem *item, ProError status, ProAppData data ) +{ + ProGeomitemdata *geom; + ProCurvedata *crv; + ProError ret; + + if ( (ret=ProGeomitemdataGet( item, &geom )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get geomitem for type %d\n", + item->type ); + return ret; + } + + crv = PRO_CURVE_DATA( geom ); + if ( (ret=ProLinedataGet( crv, end1, end2 ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get line data for axis\n" ); + return ret; + } + + return PRO_TK_NO_ERROR; +} + +extern "C" ProError +geomitem_filter( ProGeomitem *item, ProAppData data ) +{ + return PRO_TK_NO_ERROR; +} + +extern "C" ProError +hole_elem_visit( ProElement elem_tree, ProElement elem, ProElempath elem_path, ProAppData data ) +{ + ProError ret; + ProElemId elem_id; + ProValue val_junk; + ProValueData val; + + if ( (ret=ProElementIdGet( elem, &elem_id ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get element id!!!\n" ); + return ret; + } + + switch ( elem_id ) { + case PRO_E_HLE_ADD_CBORE: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + add_cbore = val.v.i; + break; + case PRO_E_HLE_ADD_CSINK: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + add_csink = val.v.i; + break; + case PRO_E_DIAMETER: + /* diameter of straight hole */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + hole_diam = val.v.d; + break; + case PRO_E_HLE_HOLEDIAM: + /* diameter of main portion of standard drilled hole */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + hole_diam = val.v.d; + break; + case PRO_E_HLE_CBOREDEPTH: + /* depth of counterbore */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + cb_depth = val.v.d; + break; + case PRO_E_HLE_CBOREDIAM: + /* diameter of counterbore */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + cb_diam = val.v.d; + break; + case PRO_E_HLE_CSINKANGLE: + /* angle of countersink (degrees ) */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + cs_angle = val.v.d; + break; + case PRO_E_HLE_CSINKDIAM: + /* diameter of countersink */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + cs_diam = val.v.d; + break; + case PRO_E_HLE_DRILLDEPTH: + /* overall depth of standard drilled hole without drill tip */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + hole_depth = val.v.d; + break; + case PRO_E_HLE_DRILLANGLE: + /* drill tip angle (degrees) */ + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + drill_angle = val.v.d; + break; + case PRO_E_HLE_DEPTH: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + hole_depth_type = val.v.i; + break; + case PRO_E_HLE_TYPE_NEW: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + hole_type = val.v.i; + break; + case PRO_E_HLE_STAN_TYPE: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + case PRO_E_STD_EDGE_CHAMF_DIM1: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + case PRO_E_STD_EDGE_CHAMF_DIM2: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + case PRO_E_STD_EDGE_CHAMF_ANGLE: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + case PRO_E_STD_EDGE_CHAMF_DIM: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + case PRO_E_STD_EDGE_CHAMF_SCHEME: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + case PRO_E_EXT_DEPTH_FROM_VALUE: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + case PRO_E_EXT_DEPTH_TO_VALUE: + if ( (ret=ProElementValueGet( elem, &val_junk )) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value\n" ); + return ret; + } + if ( (ret=ProValueDataGet( val_junk, &val ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get value data\n" ); + return ret; + } + break; + } + + return PRO_TK_NO_ERROR; +} + +extern "C" ProError +hole_elem_filter( ProElement elem_tree, ProElement elem, ProElempath elem_path, ProAppData data ) +{ + return PRO_TK_NO_ERROR; +} + +/* Subtract_hole() + * routine to create TGC primitives to make holes + * + * return value: + * 0 - do not delete this hole feature before tessellating + * 1 - delete this hole feature before tessellating + */ +extern "C" int +Subtract_hole() +{ + struct csg_ops *csg; + vect_t a, b, c, d, h; + + if ( do_facets_only ) { + if ( diameter < min_hole_diameter ) + return 1; + else + return 0; + } + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Doing a CSG hole subtraction\n" ); + } + + /* make a replacement hole using CSG */ + if ( hole_type == PRO_HLE_NEW_TYPE_STRAIGHT ) { + /* plain old straight hole */ + + if ( diameter < min_hole_diameter ) + return 1; + if ( !csg_root ) { + BU_ALLOC(csg_root, struct csg_ops); + csg = csg_root; + csg->next = NULL; + } else { + BU_ALLOC(csg, struct csg_ops); + csg->next = csg_root; + csg_root = csg; + } + bu_vls_init( &csg->name ); + bu_vls_init( &csg->dbput ); + + csg->op = '-'; + hole_no++; + bu_vls_printf( &csg->name, "hole.%d ", hole_no ); + VSUB2( h, end1, end2 ); + bn_vec_ortho( a, h ); + VCROSS( b, a, h ); + VUNITIZE( b ); + VSCALE( end2, end2, creo_to_brl_conv ); + VSCALE( a, a, radius*creo_to_brl_conv ); + VSCALE( b, b, radius*creo_to_brl_conv ); + VSCALE( h, h, creo_to_brl_conv ); + bu_vls_printf( &csg->dbput, tgc_format, + V3ARGS( end2 ), + V3ARGS( h ), + V3ARGS( a ), + V3ARGS( b ), + V3ARGS( a ), + V3ARGS( b ) ); + } else if ( hole_type == PRO_HLE_NEW_TYPE_STANDARD ) { + /* drilled hole with possible countersink and counterbore */ + point_t start; + vect_t dir; + double cb_radius; + double accum_depth=0.0; + double hole_radius=hole_diam / 2.0; + + if ( hole_diam < min_hole_diameter ) + return 1; + + VSUB2( dir, end1, end2 ); + VUNITIZE( dir ); + + VMOVE( start, end2 ); + VSCALE( start, start, creo_to_brl_conv ); + + if ( add_cbore == PRO_HLE_ADD_CBORE ) { + + if ( !csg_root ) { + BU_ALLOC(csg_root, struct csg_ops); + csg = csg_root; + csg->next = NULL; + } else { + BU_ALLOC(csg, struct csg_ops); + csg->next = csg_root; + csg_root = csg; + } + bu_vls_init( &csg->name ); + bu_vls_init( &csg->dbput ); + + csg->op = '-'; + hole_no++; + bu_vls_printf( &csg->name, "hole.%d ", hole_no ); + bn_vec_ortho( a, dir ); + VCROSS( b, a, dir ); + VUNITIZE( b ); + cb_radius = cb_diam * creo_to_brl_conv / 2.0; + VSCALE( a, a, cb_radius ); + VSCALE( b, b, cb_radius ); + VSCALE( h, dir, cb_depth * creo_to_brl_conv ); + bu_vls_printf( &csg->dbput, tgc_format, + V3ARGS( start ), + V3ARGS( h ), + V3ARGS( a ), + V3ARGS( b ), + V3ARGS( a ), + V3ARGS( b ) ); + VADD2( start, start, h ); + accum_depth += cb_depth; + cb_diam = 0.0; + cb_depth = 0.0; + } + if ( add_csink == PRO_HLE_ADD_CSINK ) { + double cs_depth; + double cs_radius=cs_diam / 2.0; + + if ( !csg_root ) { + BU_ALLOC(csg_root, struct csg_ops); + csg = csg_root; + csg->next = NULL; + } else { + BU_ALLOC(csg, struct csg_ops); + csg->next = csg_root; + csg_root = csg; + } + bu_vls_init( &csg->name ); + bu_vls_init( &csg->dbput ); + + csg->op = '-'; + hole_no++; + bu_vls_printf( &csg->name, "hole.%d ", hole_no ); + cs_depth = (cs_diam - hole_diam) / (2.0 * tan( cs_angle * M_PI / 360.0 ) ); + bn_vec_ortho( a, dir ); + VCROSS( b, a, dir ); + VUNITIZE( b ); + VMOVE( c, a ); + VMOVE( d, b ); + VSCALE( h, dir, cs_depth * creo_to_brl_conv ); + VSCALE( a, a, cs_radius * creo_to_brl_conv ); + VSCALE( b, b, cs_radius * creo_to_brl_conv ); + VSCALE( c, c, hole_diam * creo_to_brl_conv / 2.0 ); + VSCALE( d, d, hole_diam * creo_to_brl_conv / 2.0 ); + bu_vls_printf( &csg->dbput, tgc_format, + V3ARGS( start ), + V3ARGS( h ), + V3ARGS( a ), + V3ARGS( b ), + V3ARGS( c ), + V3ARGS( d ) ); + VADD2( start, start, h ); + accum_depth += cs_depth; + cs_diam = 0.0; + cs_angle = 0.0; + } + + if ( !csg_root ) { + BU_ALLOC(csg_root, struct csg_ops); + csg = csg_root; + csg->next = NULL; + } else { + BU_ALLOC(csg, struct csg_ops); + csg->next = csg_root; + csg_root = csg; + } + bu_vls_init( &csg->name ); + bu_vls_init( &csg->dbput ); + + csg->op = '-'; + hole_no++; + bu_vls_printf( &csg->name, "hole.%d ", hole_no ); + bn_vec_ortho( a, dir ); + VCROSS( b, a, dir ); + VUNITIZE( b ); + VMOVE( c, a ); + VMOVE( d, b ); + VSCALE( a, a, hole_radius * creo_to_brl_conv ); + VSCALE( b, b, hole_radius * creo_to_brl_conv ); + VSCALE( c, c, hole_radius * creo_to_brl_conv ); + VSCALE( d, d, hole_radius * creo_to_brl_conv ); + VSCALE( h, dir, (hole_depth - accum_depth) * creo_to_brl_conv ); + bu_vls_printf( &csg->dbput, tgc_format, + V3ARGS( start ), + V3ARGS( h ), + V3ARGS( a ), + V3ARGS( b ), + V3ARGS( c ), + V3ARGS( d ) ); + VADD2( start, start, h ); + hole_diam = 0.0; + hole_depth = 0.0; + if ( hole_depth_type == PRO_HLE_STD_VAR_DEPTH ) { + double tip_depth; + + if ( !csg_root ) { + BU_ALLOC(csg_root, struct csg_ops); + csg = csg_root; + csg->next = NULL; + } else { + BU_ALLOC(csg, struct csg_ops); + csg->next = csg_root; + csg_root = csg; + } + bu_vls_init( &csg->name ); + bu_vls_init( &csg->dbput ); + + csg->op = '-'; + hole_no++; + bu_vls_printf( &csg->name, "hole.%d ", hole_no ); + bn_vec_ortho( a, dir ); + VCROSS( b, a, dir ); + VUNITIZE( b ); + VMOVE( c, a ); + VMOVE( d, b ); + tip_depth = (hole_radius - MIN_RADIUS) / tan( drill_angle * M_PI / 360.0 ); + VSCALE( h, dir, tip_depth * creo_to_brl_conv ); + VSCALE( a, a, hole_radius * creo_to_brl_conv ); + VSCALE( b, b, hole_radius * creo_to_brl_conv ); + VSCALE( c, c, MIN_RADIUS ); + VSCALE( d, d, MIN_RADIUS ); + bu_vls_printf( &csg->dbput, tgc_format, + V3ARGS( start ), + V3ARGS( h ), + V3ARGS( a ), + V3ARGS( b ), + V3ARGS( c ), + V3ARGS( d ) ); + drill_angle = 0.0; + } + } else { + fprintf( stderr, "Unrecognized hole type\n" ); + return 0; + } + + return 1; +} + +extern "C" ProError +do_feature_visit( ProFeature *feat, ProError status, ProAppData data ) +{ + ProError ret; + ProElement elem_tree; + ProElempath elem_path=NULL; + + if ( (ret=ProFeatureElemtreeCreate( feat, &elem_tree ) ) == PRO_TK_NO_ERROR ) { + if ( (ret=ProElemtreeElementVisit( elem_tree, elem_path, + hole_elem_filter, hole_elem_visit, + data ) ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Element visit failed for feature (%d) of %s\n", + feat->id, curr_part_name ); + if ( ProElementFree( &elem_tree ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Error freeing element tree\n" ); + } + return ret; + } + if ( ProElementFree( &elem_tree ) != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Error freeing element tree\n" ); + } + } + + radius = 0.0; + diameter = 0.0; + distance1 = 0.0; + distance2 = 0.0; + got_diameter = 0; + got_distance1 = 0; + + if ( (ret=ProFeatureDimensionVisit( feat, check_dimension, dimension_filter, data ) ) != + PRO_TK_NO_ERROR ) { + return ret; + } + + if ( curr_feat_type == PRO_FEAT_HOLE ) { + /* need more info to recreate holes */ + if ( (ret=ProFeatureGeomitemVisit( feat, PRO_AXIS, geomitem_visit, + geomitem_filter, data ) ) != PRO_TK_NO_ERROR ) { + return ret; + } + } + + switch ( curr_feat_type ) { + case PRO_FEAT_HOLE: + if ( Subtract_hole() ) + Add_to_feature_delete_list( feat->id ); + break; + case PRO_FEAT_ROUND: + if ( got_diameter && radius < min_round_radius ) { + Add_to_feature_delete_list( feat->id ); + } + break; + case PRO_FEAT_CHAMFER: + if ( got_distance1 && distance1 < min_chamfer_dim && + distance2 < min_chamfer_dim ) { + Add_to_feature_delete_list( feat->id ); + } + break; + } + + + return ret; +} + +extern "C" int +feat_adds_material( ProFeattype feat_type ) +{ + if ( feat_type >= PRO_FEAT_UDF_THREAD ) { + return 1; + } + + switch ( feat_type ) { + case PRO_FEAT_SHAFT: + case PRO_FEAT_PROTRUSION: + case PRO_FEAT_NECK: + case PRO_FEAT_FLANGE: + case PRO_FEAT_RIB: + case PRO_FEAT_EAR: + case PRO_FEAT_DOME: + case PRO_FEAT_LOC_PUSH: + case PRO_FEAT_UDF: + case PRO_FEAT_DRAFT: + case PRO_FEAT_SHELL: + case PRO_FEAT_DOME2: + case PRO_FEAT_IMPORT: + case PRO_FEAT_MERGE: + case PRO_FEAT_MOLD: + case PRO_FEAT_OFFSET: + case PRO_FEAT_REPLACE_SURF: + case PRO_FEAT_PIPE: + return 1; + break; + default: + return 0; + break; + } + + return 0; +} + +extern "C" void +remove_holes_from_id_list( ProMdl model ) +{ + int i; + ProFeature feat; + ProError status; + ProFeattype type; + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Removing any holes from CSG list and from features to delete\n" ); + } + + free_csg_ops(); /* these are only holes */ + for ( i=0; i<feat_id_count; i++ ) { + status = ProFeatureInit( ProMdlToSolid(model), + feat_ids_to_delete[i], + &feat ); + if ( status != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get handle for id %d\n", + feat_ids_to_delete[i] ); + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Failed to get handle for id %d\n", + feat_ids_to_delete[i] ); + } + } + status = ProFeatureTypeGet( &feat, &type ); + if ( status != PRO_TK_NO_ERROR ) { + fprintf( stderr, "Failed to get feature type for id %d\n", + feat_ids_to_delete[i] ); + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Failed to get feature type for id %d\n", + feat_ids_to_delete[i] ); + } + } + if ( type == PRO_FEAT_HOLE ) { + /* remove this from the list */ + int j; + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "\tRemoving feature id %d from deletion list\n", + feat_ids_to_delete[i] ); + } + feat_id_count--; + for ( j=i; j<feat_id_count; j++ ) { + feat_ids_to_delete[j] = feat_ids_to_delete[j+1]; + } + i--; + } + } +} + + +extern "C" void +build_tree( char *sol_name, struct bu_vls *tree ) +{ + struct csg_ops *ptr; + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Building CSG tree for %s\n", sol_name ); + } + ptr = csg_root; + while ( ptr ) { + bu_vls_printf( tree, "{%c ", ptr->op ); + ptr = ptr->next; + } + + bu_vls_strcat( tree, "{ l {" ); + bu_vls_strcat( tree, sol_name ); + bu_vls_strcat( tree, "} }" ); + ptr = csg_root; + while ( ptr ) { + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Adding %c %s\n", ptr->op, bu_vls_addr( &ptr->name ) ); + } + bu_vls_printf( tree, " {l {%s}}}", bu_vls_addr( &ptr->name ) ); + ptr = ptr->next; + } + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Final tree: %s\n", bu_vls_addr( tree ) ); + } +} + +extern "C" void +output_csg_prims() +{ + struct csg_ops *ptr; + + ptr = csg_root; + + while ( ptr ) { + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Creating primitive: %s %s\n", + bu_vls_addr( &ptr->name ), bu_vls_addr( &ptr->dbput ) ); + } + + fprintf( outfp, "put {%s} %s", bu_vls_addr( &ptr->name ), bu_vls_addr( &ptr->dbput ) ); + ptr = ptr->next; + } +} + + + + +/* routine to output the top level object that is currently displayed in Pro/E */ +extern "C" void +output_top_level_object( ProMdl model, ProMdlType type ) +{ + ProName name; + ProCharName top_level; + char buffer[1024] = {0}; + + /* get its name */ + if ( ProMdlNameGet( model, name ) != PRO_TK_NO_ERROR ) { + (void)ProMessageDisplay(MSGFIL, "USER_ERROR", + "Could not get name for part!!" ); + ProMessageClear(); + fprintf( stderr, "Could not get name for part" ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + bu_strlcpy( curr_part_name, "noname", PRO_NAME_SIZE ); + } else { + (void)ProWstringToString( curr_part_name, name ); + } + + /* save name */ + bu_strlcpy( top_level, curr_part_name, sizeof(top_level) ); + + if ( logger_type == LOGGER_TYPE_ALL ) { + fprintf( logger, "Output top level object (%s)\n", top_level ); + } + + /* output the object */ + if ( type == PRO_MDL_PART ) { + /* tessellate part and output triangles */ + output_part( model ); + } else if ( type == PRO_MDL_ASSEMBLY ) { + /* visit all members of assembly */ + output_assembly( model ); + } else { + snprintf( astr, sizeof(astr), "Object %s is neither PART nor ASSEMBLY, skipping", + curr_part_name ); + (void)ProMessageDisplay(MSGFIL, "USER_WARNING", astr ); + ProMessageClear(); + fprintf( stderr, "%s\n", astr ); + (void)ProWindowRefresh( PRO_VALUE_UNUSED ); + } + + if ( type == PRO_MDL_ASSEMBLY ) { + snprintf(buffer, 1024, "put $topname comb region no tree {l %s.c {0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1}}", get_brlcad_name(top_level) ); + } else { + snprintf(buffer, 1024, "put $topname comb region no tree {l %s {0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1}}", get_brlcad_name(top_level) ); + } + + /* make a top level combination named "top", if there is not + * already one. if one does already exist, try "top.#" where + * "#" is the first available number. this combination + * contains the xform to rotate the model into BRL-CAD + * standard orientation. + */ + fprintf(outfp, + "set topname \"top\"\n" + "if { ! [catch {get $topname} ret] } {\n" + " set num 0\n" + " while { $num < 1000 } {\n" + " set topname \"top.$num\"\n" + " if { [catch {get $name} ret ] } {\n" + " break\n" + " }\n" + " incr num\n" + " }\n" + "}\n" + "if { [catch {get $topname} ret] } {\n" + " %s\n" + "}\n", + buffer + ); +} + + +/* + * Local Variables: + * mode: C + * tab-width: 8 + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Property changes on: brlcad/trunk/src/external/CREO/csg.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: brlcad/trunk/src/external/CREO/main.cpp =================================================================== --- brlcad/trunk/src/external/CREO/main.cpp (rev 0) +++ brlcad/trunk/src/external/CREO/main.cpp 2017-02-07 17:19:36 UTC (rev 69400) @@ -0,0 +1,1060 @@ +/* M A I N . C P P + * BRL-CAD + * + * Copyright (c) 2017 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file main.cpp + * + */ + +#include "common.h" +#include "creo-brl.h" + +extern "C" void +do_initialize() +{ + int i; + + /* initialize */ + bu_ptbl_init( &search_path_list, 8, "search_path" ); + + ProStringToWstring( assem_ext, "asm" ); + ProStringToWstring( part_ext, "prt" ); + + csg_root = NULL; + for ( i=0; i<NUM_OBJ_TYPES; i++ ) { + obj_type_count[i] = 0; + obj_type[i] = NULL; + } + + for ( i=0; i<NUM_FEAT_TYPES; i++ ) { + feat_type_count[i] = 0; + feat_type[i] = NULL; + } + + obj_type[0] = "PRO_TYPE_UNUSED"; + obj_type[1] = "PRO_ASSEMBLY"; + obj_type[2] = "PRO_PART"; + obj_type[3] = "PRO_FEATURE"; + obj_type[4] = "PRO_DRAWING"; + obj_type[5] = "PRO_SURFACE"; + obj_type[6] = "PRO_EDGE"; + obj_type[7] = "PRO_3DSECTION"; + obj_type[8] = "PRO_DIMENSION"; + obj_type[11] = "PRO_2DSECTION"; + obj_type[12] = "PRO_PAT_MEMBER"; + obj_type[13] = "PRO_PAT_LEADER"; + obj_type[19] = "PRO_LAYOUT"; + obj_type[21] = "PRO_AXIS"; + obj_type[25] = "PRO_CSYS"; + obj_type[28] = "PRO_REF_DIMENSION"; + obj_type[32] = "PRO_GTOL"; + obj_type[33] = "PRO_DWGFORM"; + obj_type[34] = "PRO_SUB_ASSEMBLY"; + obj_type[37] = "PRO_MFG"; + obj_type[57] = "PRO_QUILT"; + obj_type[62] = "PRO_CURVE"; + obj_type[66] = "PRO_POINT"; + obj_type[68] = "PRO_NOTE"; + obj_type[69] = "PRO_IPAR_NOTE"; + obj_type[71] = "PRO_EDGE_START"; + obj_type[72] = "PRO_EDGE_END"; + obj_type[74] = "PRO_CRV_START"; + obj_type[75] = "PRO_CRV_END"; + obj_type[76] = "PRO_SYMBOL_INSTANCE"; + obj_type[77] = "PRO_DRAFT_ENTITY"; + obj_type[79] = "PRO_DRAFT_DATUM"; + obj_type[83] = "PRO_DRAFT_GROUP"; + obj_type[84] = "PRO_DRAW_TABLE"; + obj_type[92] = "PRO_VIEW"; + obj_type[96] = "PRO_CABLE"; + obj_type[105] = "PRO_REPORT"; + obj_type[116] = "PRO_MARKUP"; + obj_type[117] = "PRO_LAYER"; + obj_type[121] = "PRO_DIAGRAM"; + obj_type[133] = "PRO_SKETCH_ENTITY"; + obj_type[144] = "PRO_DATUM_TEXT"; + obj_type[145] = "PRO_ENTITY_TEXT"; + obj_type[147] = "PRO_DRAW_TABLE_CELL"; + obj_type[176] = "PRO_DATUM_PLANE"; + obj_type[180] = "PRO_COMP_CRV"; + obj_type[211] = "PRO_BND_TABLE"; + obj_type[240] = "PRO_PARAMETER"; + obj_type[305] = "PRO_DIAGRAM_OBJECT"; + obj_type[308] = "PRO_DIAGRAM_WIRE"; + obj_type[309] = "PRO_SIMP_REP"; + obj_type[371] = "PRO_WELD_PARAMS"; + obj_type[377] = "PRO_SNAP_LINE"; + obj_type[385] = "PRO_EXTOBJ"; + obj_type[500] = "PRO_EXPLD_STATE"; + obj_type[504] = "PRO_CABLE_LOCATION"; + obj_type[533] = "PRO_RELSET"; + obj_type[555] = "PRO_ANALYSIS"; + obj_type[556] = "PRO_SURF_CRV"; + obj_type[625] = "PRO_LOG_SRF"; + obj_type[622] = "PRO_SOLID_GEOMETRY"; + obj_type[626] = "PRO_LOG_EDG"; + obj_type[627] = "PRO_DESKTOP"; + obj_type[628] = "PRO_SYMBOL_DEFINITION"; + + feat_type[0] = "PRO_FEAT_FIRST_FEAT"; + feat_type[911 - FEAT_TYPE_OFFSET] = "PRO_FEAT_HOLE"; + feat_type[912 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SHAFT"; + feat_type[913 - FEAT_TYPE_OFFSET] = "PRO_FEAT_ROUND"; + feat_type[914 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CHAMFER"; + feat_type[915 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SLOT"; + feat_type[916 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CUT"; + feat_type[917 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PROTRUSION"; + feat_type[918 - FEAT_TYPE_OFFSET] = "PRO_FEAT_NECK"; + feat_type[919 - FEAT_TYPE_OFFSET] = "PRO_FEAT_FLANGE"; + feat_type[920 - FEAT_TYPE_OFFSET] = "PRO_FEAT_RIB"; + feat_type[921 - FEAT_TYPE_OFFSET] = "PRO_FEAT_EAR"; + feat_type[922 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DOME"; + feat_type[923 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DATUM"; + feat_type[924 - FEAT_TYPE_OFFSET] = "PRO_FEAT_LOC_PUSH"; + feat_type[925 - FEAT_TYPE_OFFSET] = "PRO_FEAT_UDF"; + feat_type[926 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DATUM_AXIS"; + feat_type[927 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DRAFT"; + feat_type[928 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SHELL"; + feat_type[929 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DOME2"; + feat_type[930 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CORN_CHAMF"; + feat_type[931 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DATUM_POINT"; + feat_type[932 - FEAT_TYPE_OFFSET] = "PRO_FEAT_IMPORT"; + feat_type[932 - FEAT_TYPE_OFFSET] = "PRO_FEAT_IGES"; + feat_type[933 - FEAT_TYPE_OFFSET] = "PRO_FEAT_COSMETIC"; + feat_type[934 - FEAT_TYPE_OFFSET] = "PRO_FEAT_ETCH"; + feat_type[935 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MERGE"; + feat_type[936 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MOLD"; + feat_type[937 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SAW"; + feat_type[938 - FEAT_TYPE_OFFSET] = "PRO_FEAT_TURN"; + feat_type[939 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MILL"; + feat_type[940 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DRILL"; + feat_type[941 - FEAT_TYPE_OFFSET] = "PRO_FEAT_OFFSET"; + feat_type[942 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DATUM_SURF"; + feat_type[943 - FEAT_TYPE_OFFSET] = "PRO_FEAT_REPLACE_SURF"; + feat_type[944 - FEAT_TYPE_OFFSET] = "PRO_FEAT_GROOVE"; + feat_type[945 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE"; + feat_type[946 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DATUM_QUILT"; + feat_type[947 - FEAT_TYPE_OFFSET] = "PRO_FEAT_ASSEM_CUT"; + feat_type[948 - FEAT_TYPE_OFFSET] = "PRO_FEAT_UDF_THREAD"; + feat_type[949 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CURVE"; + feat_type[950 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SRF_MDL"; + feat_type[952 - FEAT_TYPE_OFFSET] = "PRO_FEAT_WALL"; + feat_type[953 - FEAT_TYPE_OFFSET] = "PRO_FEAT_BEND"; + feat_type[954 - FEAT_TYPE_OFFSET] = "PRO_FEAT_UNBEND"; + feat_type[955 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CUT_SMT"; + feat_type[956 - FEAT_TYPE_OFFSET] = "PRO_FEAT_FORM"; + feat_type[957 - FEAT_TYPE_OFFSET] = "PRO_FEAT_THICKEN"; + feat_type[958 - FEAT_TYPE_OFFSET] = "PRO_FEAT_BEND_BACK"; + feat_type[959 - FEAT_TYPE_OFFSET] = "PRO_FEAT_UDF_NOTCH"; + feat_type[960 - FEAT_TYPE_OFFSET] = "PRO_FEAT_UDF_PUNCH"; + feat_type[961 - FEAT_TYPE_OFFSET] = "PRO_FEAT_INT_UDF"; + feat_type[962 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SPLIT_SURF"; + feat_type[963 - FEAT_TYPE_OFFSET] = "PRO_FEAT_GRAPH"; + feat_type[964 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SMT_MFG_PUNCH"; + feat_type[965 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SMT_MFG_CUT"; + feat_type[966 - FEAT_TYPE_OFFSET] = "PRO_FEAT_FLATTEN"; + feat_type[967 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SET"; + feat_type[968 - FEAT_TYPE_OFFSET] = "PRO_FEAT_VDA"; + feat_type[969 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SMT_MFG_FORM"; + feat_type[970 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SMT_PUNCH_PNT"; + feat_type[971 - FEAT_TYPE_OFFSET] = "PRO_FEAT_LIP"; + feat_type[972 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MANUAL"; + feat_type[973 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MFG_GATHER"; + feat_type[974 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MFG_TRIM"; + feat_type[975 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MFG_USEVOL"; + feat_type[976 - FEAT_TYPE_OFFSET] = "PRO_FEAT_LOCATION"; + feat_type[977 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CABLE_SEGM"; + feat_type[978 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CABLE"; + feat_type[979 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CSYS"; + feat_type[980 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CHANNEL"; + feat_type[937 - FEAT_TYPE_OFFSET] = "PRO_FEAT_WIRE_EDM"; + feat_type[981 - FEAT_TYPE_OFFSET] = "PRO_FEAT_AREA_NIBBLE"; + feat_type[982 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PATCH"; + feat_type[983 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PLY"; + feat_type[984 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CORE"; + feat_type[985 - FEAT_TYPE_OFFSET] = "PRO_FEAT_EXTRACT"; + feat_type[986 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MFG_REFINE"; + feat_type[987 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SILH_TRIM"; + feat_type[988 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SPLIT"; + feat_type[989 - FEAT_TYPE_OFFSET] = "PRO_FEAT_EXTEND"; + feat_type[990 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SOLIDIFY"; + feat_type[991 - FEAT_TYPE_OFFSET] = "PRO_FEAT_INTERSECT"; + feat_type[992 - FEAT_TYPE_OFFSET] = "PRO_FEAT_ATTACH"; + feat_type[993 - FEAT_TYPE_OFFSET] = "PRO_FEAT_XSEC"; + feat_type[994 - FEAT_TYPE_OFFSET] = "PRO_FEAT_UDF_ZONE"; + feat_type[995 - FEAT_TYPE_OFFSET] = "PRO_FEAT_UDF_CLAMP"; + feat_type[996 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DRL_GRP"; + feat_type[997 - FEAT_TYPE_OFFSET] = "PRO_FEAT_ISEGM"; + feat_type[998 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CABLE_COSM"; + feat_type[999 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SPOOL"; + feat_type[1000 - FEAT_TYPE_OFFSET] = "PRO_FEAT_COMPONENT"; + feat_type[1001 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MFG_MERGE"; + feat_type[1002 - FEAT_TYPE_OFFSET] = "PRO_FEAT_FIXSETUP"; + feat_type[1002 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SETUP"; + feat_type[1003 - FEAT_TYPE_OFFSET] = "PRO_FEAT_FLAT_PAT"; + feat_type[1004 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CONT_MAP"; + feat_type[1005 - FEAT_TYPE_OFFSET] = "PRO_FEAT_EXP_RATIO"; + feat_type[1006 - FEAT_TYPE_OFFSET] = "PRO_FEAT_RIP"; + feat_type[1007 - FEAT_TYPE_OFFSET] = "PRO_FEAT_OPERATION"; + feat_type[1008 - FEAT_TYPE_OFFSET] = "PRO_FEAT_WORKCELL"; + feat_type[1009 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CUT_MOTION"; + feat_type[1013 - FEAT_TYPE_OFFSET] = "PRO_FEAT_BLD_PATH"; + feat_type[1013 - FEAT_TYPE_OFFSET] = "PRO_FEAT_CUSTOMIZE"; + feat_type[1014 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DRV_TOOL_SKETCH"; + feat_type[1015 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DRV_TOOL_EDGE"; + feat_type[1016 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DRV_TOOL_CURVE"; + feat_type[1017 - FEAT_TYPE_OFFSET] = "PRO_FEAT_DRV_TOOL_SURF"; + feat_type[1018 - FEAT_TYPE_OFFSET] = "PRO_FEAT_MAT_REMOVAL"; + feat_type[1019 - FEAT_TYPE_OFFSET] = "PRO_FEAT_TORUS"; + feat_type[1020 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE_SET_START"; + feat_type[1021 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE_PNT_PNT"; + feat_type[1022 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE_EXT"; + feat_type[1023 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE_TRIM"; + feat_type[1024 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE_FOLL"; + feat_type[1025 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE_JOIN"; + feat_type[1026 - FEAT_TYPE_OFFSET] = "PRO_FEAT_AUXILIARY"; + feat_type[1027 - FEAT_TYPE_OFFSET] = "PRO_FEAT_PIPE_LINE"; + feat_type[1028 - FEAT_TYPE_OFFSET] = "PRO_FEAT_LINE_STOCK"; + feat_type[1029 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SLD_PIPE "; + feat_type[1030 - FEAT_TYPE_OFFSET] = "PRO_FEAT_BULK_OBJECT"; + feat_type[1031 - FEAT_TYPE_OFFSET] = "PRO_FEAT_SHRINKAGE "; + feat_type[1032 - FEAT_TYPE_OFFSET] = "P... [truncated message content] |