patch #469 (https://sourceforge.net/p/brlcad/patches/469/), version 217-06-23, from Shubham Rathore "annot.c"
it's still buggy but because of implementing the new annotation primitive it shouldn't interfere the already existing functionality svn:revision:69940 svn:branch:trunk svn:account:d_rossberg
This commit is contained in:
1 parent
20cdce99d4
commit
cb83958bf5
17 files changed
+2318
-61
No files matched your search
+2
-1
@@ -123,7 +123,7 @@ __BEGIN_DECLS
|
||||
#define RT_TOR_INTERNAL_MAGIC 0x9bffed87 /**< ???? */
|
||||
#define RT_VOL_INTERNAL_MAGIC 0x987ba1d0 /**< ?{?? */
|
||||
#define RT_PNTS_INTERNAL_MAGIC 0x706e7473 /**< pnts */
|
||||
#define RT_ANNOTATION_INTERNAL_MAGIC 0x616e6e6f /**< anno */
|
||||
#define RT_ANNOT_INTERNAL_MAGIC 0x616e6e6f /**< anno */
|
||||
#define RT_HRT_INTERNAL_MAGIC 0x6872743f /**< hrt? */
|
||||
|
||||
/* n-manifold geometry */
|
||||
@@ -210,6 +210,7 @@ __BEGIN_DECLS
|
||||
#define CURVE_CARC_MAGIC 0x63617263 /**< carc */
|
||||
#define CURVE_LSEG_MAGIC 0x6c736567 /**< lseg */
|
||||
#define CURVE_NURB_MAGIC 0x6e757262 /**< nurb */
|
||||
#define ANN_TSEG_MAGIC 0x74736567 /**< tseg */
|
||||
#define DB5_RAW_INTERNAL_MAGIC 0x64357269 /**< d5ri */
|
||||
#define DBI_MAGIC 0x57204381 /**< W C? */
|
||||
#define DB_FULL_PATH_MAGIC 0x64626670 /**< dbfp */
|
||||
|
||||
@@ -154,6 +154,7 @@ __BEGIN_DECLS
|
||||
#include "./rt/primitives/ell.h"
|
||||
#include "./rt/primitives/tgc.h"
|
||||
#include "./rt/primitives/sketch.h"
|
||||
#include "./rt/primitives/annot.h"
|
||||
#include "./rt/primitives/bot.h"
|
||||
#include "./rt/primitives/brep.h"
|
||||
#include "./rt/primitives/tor.h"
|
||||
|
||||
@@ -373,6 +373,16 @@ struct sketch_rec {
|
||||
unsigned char skt_count[4]; /* number of additional granules */
|
||||
}; /* struct sketch_rec */
|
||||
|
||||
struct annot_rec {
|
||||
char ant_id; /*DBID_ANNOT */
|
||||
char ant_pad;
|
||||
char ant_name[NAMESIZE];
|
||||
unsigned char ant_V[8*3]; /* orgin map */
|
||||
unsigned char ant_vert_count[4]; /* number of vertices in annotation */
|
||||
unsigned char ant_seg_count[4]; /* number of segments in annotation */
|
||||
unsigned char ant_count[4]; /* number of additional granules */
|
||||
}; /* struct annot_rec */
|
||||
|
||||
struct cline_rec {
|
||||
char cli_id; /* DBID_CLINE */
|
||||
char cli_pad;
|
||||
@@ -422,6 +432,7 @@ union record {
|
||||
#define DBID_PARTICLE 'p' /* a particle (lozenge) */
|
||||
#define DBID_NMG 'N' /* NMG solid */
|
||||
#define DBID_SKETCH 'd' /* 2D sketch */
|
||||
#define DBID_ANNOT 'a' /* 2D annotations */
|
||||
#define DBID_EXTR 'e' /* solid of extrusion */
|
||||
#define DBID_CLINE 'c' /* FASTGEN4 CLINE solid */
|
||||
#define DBID_BOT 't' /* Bag o' triangles */
|
||||
@@ -463,6 +474,9 @@ union record {
|
||||
/* sketch */
|
||||
struct sketch_rec skt;
|
||||
|
||||
/* annotation */
|
||||
struct annot_rec ant;
|
||||
|
||||
/* FASTGEN4 CLINE element */
|
||||
struct cline_rec cli;
|
||||
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ struct db5_ondisk_header {
|
||||
|
||||
#define DB5_MINORTYPE_BRLCAD_REVOLVE 40
|
||||
#define DB5_MINORTYPE_BRLCAD_PNTS 41
|
||||
#define DB5_MINORTYPE_BRLCAD_ANNOTATION 42
|
||||
#define DB5_MINORTYPE_BRLCAD_ANNOT 42
|
||||
#define DB5_MINORTYPE_BRLCAD_HRT 43
|
||||
#define DB5_MINORTYPE_BRLCAD_DATUM 44
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
#define ID_HYP 38 /**< @brief Hyperboloid of one sheet */
|
||||
#define ID_REVOLVE 40 /**< @brief Solid of Revolution */
|
||||
#define ID_PNTS 41 /**< @brief Collection of Points */
|
||||
#define ID_ANNOTATION 42 /**< @brief Annotation */
|
||||
#define ID_ANNOT 42 /**< @brief Annotation */
|
||||
#define ID_HRT 43 /**< @brief Heart */
|
||||
#define ID_DATUM 44 /**< @brief Datum references */
|
||||
|
||||
|
||||
+46
-19
@@ -25,7 +25,7 @@
|
||||
* These structures are what the struct rt_db_internal generic pointer
|
||||
* idb_ptr points at, based on idb_type indicating a solid id ID_xxx,
|
||||
* such as ID_TGC.
|
||||
*
|
||||
*
|
||||
*/
|
||||
/** @{ */
|
||||
/** @file rt/geom.h */
|
||||
@@ -569,7 +569,7 @@ struct rt_dsp_internal{
|
||||
mat_t dsp_mtos; /**< @brief model to solid space */
|
||||
/* END OF USER SETTABLE VARIABLES, BEGIN INTERNAL STUFF */
|
||||
mat_t dsp_stom; /**< @brief solid to model space
|
||||
* computed from dsp_mtos */
|
||||
* computed from dsp_mtos */
|
||||
unsigned short *dsp_buf; /**< @brief actual data */
|
||||
struct bu_mapped_file *dsp_mp; /**< @brief mapped file for data */
|
||||
struct rt_db_internal *dsp_bip; /**< @brief db object for data */
|
||||
@@ -601,7 +601,7 @@ struct rt_curve {
|
||||
|
||||
|
||||
/**
|
||||
* used by the sketch and solid of extrusion
|
||||
* used by the sketch, solid of extrusion and the annotation primitive
|
||||
*/
|
||||
struct line_seg /**< @brief line segment */
|
||||
{
|
||||
@@ -923,33 +923,60 @@ struct rt_pnts_internal {
|
||||
#define RT_PNTS_CK_MAGIC(_p) BU_CKMAG(_p, RT_PNTS_INTERNAL_MAGIC, "rt_pnts_internal")
|
||||
/** @} */
|
||||
|
||||
/** @addtogroup rt_annotation */
|
||||
/** @addtogroup rt_anno */
|
||||
/** @{ */
|
||||
/*
|
||||
* ID_ANNOTATION
|
||||
* ID_ANNO
|
||||
*
|
||||
* Annotations are used to provide labels in-scene when viewing geometry. Leaders connect labels
|
||||
* Annotations are used to provide labels in-scene when viewing geometry. Leaders connect labels
|
||||
* to geometry objects or fixed points in space.
|
||||
*
|
||||
* container for the annotation primitive
|
||||
*/
|
||||
|
||||
struct rt_annotation_internal
|
||||
{
|
||||
uint32_t magic;
|
||||
point_t V; /**< @brief vertex, start and end point of loop to be extruded */
|
||||
vect_t h; /**< @brief extrusion vector, may not be in (u_vec X v_vec) plane */
|
||||
vect_t u_vec; /**< @brief vector in U parameter direction */
|
||||
vect_t v_vec; /**< @brief vector in V parameter direction */
|
||||
int view_aligned;
|
||||
struct bu_vls label; /**< @brief either user supplied labels, format strings, or empty */
|
||||
struct rt_sketch_internal *skt; /**< @brief pointer to sketch holding label decoration (if any) - same plane as text plane */
|
||||
struct rt_ant {
|
||||
size_t count; /**< @brief number of segments in the annotation */
|
||||
int *reverse; /**< array of boolean flags indicating if the
|
||||
* segment should be reversed */
|
||||
void **segments; /**< @brief array of annotation segment pointer */
|
||||
};
|
||||
|
||||
/**
|
||||
* Note that the u_vec and v_vec are not unit vectors, their magnitude
|
||||
* and direction are used for scaling and rotation.
|
||||
* used by the annotation primitive
|
||||
*/
|
||||
#define RT_ANNOTATION_CK_MAGIC(_p) BU_CKMAG(_p, RT_ANNOTATION_INTERNAL_MAGIC, "rt_annotation_internal")
|
||||
|
||||
struct txt_seg {
|
||||
uint32_t magic;
|
||||
int ref_pt; /** reference point */
|
||||
int pt_rel_pos; /** flag describing the position relative to the ref_point */
|
||||
struct bu_vls label;
|
||||
};
|
||||
|
||||
struct rt_annot_internal
|
||||
{
|
||||
uint32_t magic;
|
||||
point_t V; /**< @brief vertex, maps to the origin in the 2D system */
|
||||
size_t vert_count; /**< @brief number of vertices */
|
||||
point2d_t *verts; /**< @brief array of vertices that serve as control points */
|
||||
struct rt_ant ant; /**< @brief segments in the annotation */
|
||||
};
|
||||
|
||||
/**
|
||||
* placement flags
|
||||
*/
|
||||
|
||||
#define RT_ANNOT_POS_BL 1
|
||||
#define RT_ANNOT_POS_BC 2
|
||||
#define RT_ANNOT_POS_BR 3
|
||||
#define RT_ANNOT_POS_ML 4
|
||||
#define RT_ANNOT_POS_MC 5
|
||||
#define RT_ANNOT_POS_MR 6
|
||||
#define RT_ANNOT_POS_TL 7
|
||||
#define RT_ANNOT_POS_TC 8
|
||||
#define RT_ANNOT_POS_TR 9
|
||||
|
||||
|
||||
#define RT_ANNOT_CK_MAGIC(_p) BU_CKMAG(_p, RT_ANNOT_INTERNAL_MAGIC, "rt_annot_internal")
|
||||
/** @} */
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
set(primitives_headers
|
||||
arb8.h
|
||||
annot.h
|
||||
bot.h
|
||||
brep.h
|
||||
cline.h
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/* A N N O T . H
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 1993-2016 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library 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 library 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.
|
||||
*/
|
||||
/** @addtogroup rt_annot */
|
||||
/** @{ */
|
||||
/** @file rt/primitives/annot.h */
|
||||
|
||||
#ifndef RT_PRIMITIVES_ANNOT_H
|
||||
#define RT_PRIMITIVES_ANNOT_H
|
||||
|
||||
#include "common.h"
|
||||
#include "vmath.h"
|
||||
#include "bu/list.h"
|
||||
#include "bu/vls.h"
|
||||
#include "bn/tol.h"
|
||||
#include "rt/defines.h"
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
RT_EXPORT int rt_pos_flag(int *pos_flag, int p_hor, int p_ver);
|
||||
|
||||
RT_EXPORT int rt_check_pos(const struct txt_seg *tsg, char **rel_pos);
|
||||
|
||||
RT_EXPORT extern int ant_to_vlist(struct bu_list *vhead,
|
||||
const struct rt_tess_tol *ttol,
|
||||
point_t V,
|
||||
struct rt_annot_internal *annot_ip,
|
||||
struct rt_ant *ant);
|
||||
|
||||
RT_EXPORT extern int rt_check_ant(const struct rt_ant *ant,
|
||||
const struct rt_annot_internal *annot_ip,
|
||||
int noisy);
|
||||
|
||||
RT_EXPORT extern void rt_copy_ant(struct rt_ant *ant_out,
|
||||
const struct rt_ant *ant_in);
|
||||
|
||||
RT_EXPORT extern void rt_ant_free(struct rt_ant *ant);
|
||||
|
||||
RT_EXPORT extern struct rt_annot_internal *rt_annot_sketch(const struct rt_annot_internal *annot_ip);
|
||||
RT_EXPORT extern int ant_to_tcl_list(struct bu_vls *vls,
|
||||
struct rt_ant *ant);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* RT_PRIMITIVES_ANNOT_H */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* tab-width: 8
|
||||
* mode: C
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "stroustrup"
|
||||
* End:
|
||||
* ex: shiftwidth=4 tabstop=8
|
||||
*/
|
||||
@@ -505,6 +505,14 @@ WDB_EXPORT int mk_sketch(
|
||||
const char *name,
|
||||
const struct rt_sketch_internal *skt );
|
||||
|
||||
/**
|
||||
* Make a annotation
|
||||
*/
|
||||
WDB_EXPORT int mk_annot(
|
||||
struct rt_wdb *fp,
|
||||
const char *name,
|
||||
const struct rt_annot_internal *ann );
|
||||
|
||||
/**
|
||||
* Make an extrusion solid
|
||||
*/
|
||||
|
||||
@@ -150,6 +150,8 @@ bu_identify_magic(register uint32_t magic)
|
||||
return "rt_rpc_internal";
|
||||
case RT_SKETCH_INTERNAL_MAGIC:
|
||||
return "rt_sketch_internal";
|
||||
case RT_ANNOT_INTERNAL_MAGIC:
|
||||
return "rt_annot_internal";
|
||||
case RT_SUBMODEL_INTERNAL_MAGIC:
|
||||
return "rt_submodel_internal";
|
||||
case RT_SUPERELL_INTERNAL_MAGIC:
|
||||
|
||||
@@ -505,6 +505,8 @@ dm_label_primitive(struct rt_wdb *wdbp,
|
||||
break;
|
||||
case DB5_MINORTYPE_BRLCAD_SKETCH:
|
||||
break;
|
||||
case DB5_MINORTYPE_BRLCAD_ANNOT:
|
||||
break;
|
||||
case DB5_MINORTYPE_BRLCAD_EXTRUDE:
|
||||
break;
|
||||
case DB5_MINORTYPE_BRLCAD_SUBMODEL:
|
||||
|
||||
@@ -338,6 +338,15 @@ _ged_get_solid_keypoint(struct ged *const gedp,
|
||||
VMOVE(mpt, skt->V);
|
||||
break;
|
||||
}
|
||||
case ID_ANNOT:
|
||||
{
|
||||
struct rt_annot_internal *ann =
|
||||
(struct rt_annot_internal *)ip->idb_ptr;
|
||||
RT_SKETCH_CK_MAGIC(ann);
|
||||
|
||||
VMOVE(mpt, ann->V);
|
||||
break;
|
||||
}
|
||||
case ID_EXTRUDE:
|
||||
{
|
||||
struct rt_extrude_internal *extr =
|
||||
|
||||
+85
-16
@@ -623,6 +623,23 @@ static char *p_datum[] = {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* TODO:
|
||||
* Add support for the line,curve,beizer,nurb
|
||||
*/
|
||||
static char *p_annot[] = {
|
||||
"Enter the point to be annotated: ",
|
||||
"Enter Y: ",
|
||||
"Enter Z: ",
|
||||
"Enter the text label: ",
|
||||
"Enter X,Y for the text placement: ",
|
||||
"Enter Y: ",
|
||||
"Enter the relative vertical position(1->bottom, 2->middle, 3->top): ",
|
||||
"Enter the relative horizontal position(1->right, 2->center, 3->left): "
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* helper function that infers a boolean value from a given string
|
||||
* returning 0 or 1 for false and true respectively.
|
||||
@@ -848,14 +865,14 @@ dsp_in_v5(struct ged *gedp, const char **cmd_argvs, struct rt_db_internal *inter
|
||||
dsp->dsp_smooth = atoi(cmd_argvs[7]);
|
||||
|
||||
switch (*cmd_argvs[8]) {
|
||||
case 'a': /* adaptive */
|
||||
case 'a': /* adaptive */
|
||||
case 'A':
|
||||
dsp->dsp_cuttype = DSP_CUT_DIR_ADAPT;
|
||||
break;
|
||||
case 'l': /* lower left to upper right */
|
||||
case 'l': /* lower left to upper right */
|
||||
dsp->dsp_cuttype = DSP_CUT_DIR_llUR;
|
||||
break;
|
||||
case 'L': /* Upper Left to lower right */
|
||||
case 'L': /* Upper Left to lower right */
|
||||
dsp->dsp_cuttype = DSP_CUT_DIR_ULlr;
|
||||
break;
|
||||
default:
|
||||
@@ -1190,8 +1207,8 @@ ars_in(struct ged *gedp, int argc, const char **argv, struct rt_db_internal *int
|
||||
struct rt_ars_internal *arip;
|
||||
size_t i;
|
||||
size_t total_points;
|
||||
int cv; /* current curve (waterline) # */
|
||||
size_t axis; /* current fastf_t in waterline */
|
||||
int cv; /* current curve (waterline) # */
|
||||
size_t axis; /* current fastf_t in waterline */
|
||||
int ncurves_minus_one;
|
||||
int num_pts = 0;
|
||||
int num_curves = 0;
|
||||
@@ -1225,8 +1242,8 @@ ars_in(struct ged *gedp, int argc, const char **argv, struct rt_db_internal *int
|
||||
return GED_MORE;
|
||||
}
|
||||
|
||||
total_vals_needed = 2 + /* #rows, #pts/row */
|
||||
(ELEMENTS_PER_POINT * 2) + /* the first point, and very last */
|
||||
total_vals_needed = 2 + /* #rows, #pts/row */
|
||||
(ELEMENTS_PER_POINT * 2) + /* the first point, and very last */
|
||||
(num_pts * ELEMENTS_PER_POINT * (num_curves-2)); /* the curves */
|
||||
|
||||
if (vals_present < (total_vals_needed - ELEMENTS_PER_POINT)) {
|
||||
@@ -1386,7 +1403,7 @@ arb_in(struct ged *gedp, const char **cmd_argvs, struct rt_db_internal *intern)
|
||||
aip = (struct rt_arb_internal *)intern->idb_ptr;
|
||||
aip->magic = RT_ARB_INTERNAL_MAGIC;
|
||||
|
||||
n = atoi(&cmd_argvs[2][3]); /* get # from "arb#" */
|
||||
n = atoi(&cmd_argvs[2][3]); /* get # from "arb#" */
|
||||
for (j = 0; j < n; j++)
|
||||
for (i = 0; i < ELEMENTS_PER_POINT; i++)
|
||||
aip->pt[j][i] = atof(cmd_argvs[3+i+3*j]) * gedp->ged_wdbp->dbip->dbi_local2base;
|
||||
@@ -1409,7 +1426,7 @@ arb_in(struct ged *gedp, const char **cmd_argvs, struct rt_db_internal *intern)
|
||||
VMOVE(aip->pt[7], aip->pt[4]);
|
||||
}
|
||||
|
||||
return GED_OK; /* success */
|
||||
return GED_OK; /* success */
|
||||
}
|
||||
|
||||
|
||||
@@ -1457,8 +1474,8 @@ ell_in(struct ged *gedp, const char **cmd_argvs, struct rt_db_internal *intern)
|
||||
int i, n;
|
||||
struct rt_ell_internal *eip;
|
||||
|
||||
n = 12; /* ELL has twelve params */
|
||||
if (cmd_argvs[2][3] != '\0') /* ELLG and ELL1 have seven */
|
||||
n = 12; /* ELL has twelve params */
|
||||
if (cmd_argvs[2][3] != '\0') /* ELLG and ELL1 have seven */
|
||||
n = 7;
|
||||
|
||||
intern->idb_major_type = DB5_MAJORTYPE_BRLCAD;
|
||||
@@ -1694,8 +1711,8 @@ tec_in(struct ged *gedp, const char **cmd_argvs, struct rt_db_internal *intern)
|
||||
return GED_ERROR;
|
||||
}
|
||||
|
||||
VSCALE(tip->c, tip->a, 1./ratio); /* C vector */
|
||||
VSCALE(tip->d, tip->b, 1./ratio); /* D vector */
|
||||
VSCALE(tip->c, tip->a, 1./ratio); /* C vector */
|
||||
VSCALE(tip->d, tip->b, 1./ratio); /* D vector */
|
||||
|
||||
return GED_OK;
|
||||
}
|
||||
@@ -1734,8 +1751,8 @@ rec_in(struct ged *gedp, const char **cmd_argvs, struct rt_db_internal *intern)
|
||||
return GED_ERROR;
|
||||
}
|
||||
|
||||
VMOVE(tip->c, tip->a); /* C vector */
|
||||
VMOVE(tip->d, tip->b); /* D vector */
|
||||
VMOVE(tip->c, tip->a); /* C vector */
|
||||
VMOVE(tip->d, tip->b); /* D vector */
|
||||
|
||||
return GED_OK;
|
||||
}
|
||||
@@ -2387,7 +2404,7 @@ superell_in(struct ged *gedp, char *cmd_argvs[], struct rt_db_internal *intern)
|
||||
int i, n;
|
||||
struct rt_superell_internal *eip;
|
||||
|
||||
n = 14; /* SUPERELL has 12 (same as ELL) + 2 (for <n, e>) params */
|
||||
n = 14; /* SUPERELL has 12 (same as ELL) + 2 (for <n, e>) params */
|
||||
|
||||
intern->idb_type = ID_SUPERELL;
|
||||
intern->idb_meth = &OBJ[ID_SUPERELL];
|
||||
@@ -3087,6 +3104,54 @@ argc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* reads annot parameters from the keyboard
|
||||
*
|
||||
* returns 0 if successul read
|
||||
* 1 if unsuccessful read
|
||||
*/
|
||||
static int
|
||||
annot_in(struct ged *gedp, const char **cmd_argvs, struct rt_db_internal *intern)
|
||||
{
|
||||
int i, p_ver, p_hor;
|
||||
struct rt_annot_internal *anip;
|
||||
struct txt_seg *tsg;
|
||||
|
||||
intern->idb_type = ID_ANNOT;
|
||||
intern->idb_meth = &OBJ[ID_ANNOT];
|
||||
BU_ALLOC(intern->idb_ptr, struct rt_annot_internal);
|
||||
anip = (struct rt_annot_internal *)intern->idb_ptr;
|
||||
anip->magic = RT_ANNOT_INTERNAL_MAGIC;
|
||||
|
||||
|
||||
for (i = 0; i<ELEMENTS_PER_POINT; i++)
|
||||
anip->V[i] = atof(cmd_argvs[3+i]) * gedp->ged_wdbp->dbip->dbi_local2base;
|
||||
|
||||
anip->vert_count = 1;
|
||||
anip->verts = (point2d_t *)bu_calloc(anip->vert_count, sizeof(point2d_t), "verts");
|
||||
|
||||
BU_ALLOC(tsg, struct txt_seg);
|
||||
|
||||
tsg->magic = ANN_TSEG_MAGIC;
|
||||
tsg->ref_pt = 0;
|
||||
bu_vls_init(&tsg->label);
|
||||
bu_vls_strcpy(&tsg->label, cmd_argvs[6]);
|
||||
|
||||
|
||||
|
||||
for (i = 0; i<ELEMENTS_PER_POINT2D; i++)
|
||||
anip->verts[0][i] = atof(cmd_argvs[7+i]) * gedp->ged_wdbp->dbip->dbi_local2base;
|
||||
|
||||
|
||||
p_ver = atoi(cmd_argvs[9]);
|
||||
p_hor = atoi(cmd_argvs[10]);
|
||||
|
||||
rt_pos_flag(&tsg->pt_rel_pos, p_hor, p_ver);
|
||||
|
||||
return GED_OK;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ged_in(struct ged *gedp, int argc, const char *argv[])
|
||||
{
|
||||
@@ -3352,6 +3417,10 @@ ged_in(struct ged *gedp, int argc, const char *argv[])
|
||||
nvals = 3*3 + 1 + 2;
|
||||
menu = p_joint;
|
||||
fn_in = joint_in;
|
||||
} else if (BU_STR_EQUAL(argv[2], "annot")) {
|
||||
nvals = 3 + 1+ 2 + 2;
|
||||
menu = p_annot;
|
||||
fn_in = annot_in;
|
||||
} else if (BU_STR_EQUAL(argv[2], "pnts")) {
|
||||
switch (pnts_in(gedp, argc, argv, &internal, p_pnts)) {
|
||||
case GED_ERROR:
|
||||
|
||||
@@ -77,6 +77,7 @@ set(LIBRT_SOURCES
|
||||
op.c
|
||||
pr.c
|
||||
prep.c
|
||||
primitives/annot/annot.c
|
||||
primitives/arb8/arb8.c
|
||||
primitives/arb8/arb8_brep.cpp
|
||||
primitives/arb8/arb8_mirror.c
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -105,6 +105,7 @@ RT_DECLARE_INTERFACE(grp);
|
||||
RT_DECLARE_INTERFACE(hf);
|
||||
RT_DECLARE_INTERFACE(dsp);
|
||||
RT_DECLARE_INTERFACE(sketch);
|
||||
RT_DECLARE_INTERFACE(annot);
|
||||
RT_DECLARE_INTERFACE(extrude);
|
||||
RT_DECLARE_INTERFACE(submodel);
|
||||
RT_DECLARE_INTERFACE(cline);
|
||||
@@ -151,6 +152,7 @@ extern void rt_comb_ifree(struct rt_db_internal *ip);
|
||||
extern int rt_ebm_form(struct bu_vls *logstr, const struct rt_functab *ftp);
|
||||
extern int rt_bot_form(struct bu_vls *logstr, const struct rt_functab *ftp);
|
||||
extern int rt_sketch_form(struct bu_vls *logstr, const struct rt_functab *ftp);
|
||||
extern int rt_annot_form(struct bu_vls *logstr, const struct rt_functab *ftp);
|
||||
extern int rt_cline_form(struct bu_vls *logstr, const struct rt_functab *ftp);
|
||||
extern int rt_extrude_form(struct bu_vls *logstr, const struct rt_functab *ftp);
|
||||
|
||||
@@ -2137,39 +2139,39 @@ const struct rt_functab OBJ[] = {
|
||||
|
||||
{
|
||||
/* 42 */
|
||||
RT_FUNCTAB_MAGIC, "ID_ANNOTATION", "anno",
|
||||
RT_FUNCTAB_MAGIC, "ID_ANNOT", "annot",
|
||||
0, /* ft_use_rpp */
|
||||
NULL, /* prep */
|
||||
NULL, /* shot */
|
||||
NULL, /* print */
|
||||
NULL, /* norm */
|
||||
RTFUNCTAB_FUNC_PREP_CAST(rt_annot_prep),
|
||||
RTFUNCTAB_FUNC_SHOT_CAST(rt_annot_shot),
|
||||
RTFUNCTAB_FUNC_PRINT_CAST(rt_annot_print),
|
||||
RTFUNCTAB_FUNC_NORM_CAST(rt_annot_norm),
|
||||
NULL, /* piece_shot */
|
||||
NULL, /* piece_hitsegs */
|
||||
NULL, /* uv */
|
||||
NULL, /* curve */
|
||||
NULL, /* classify */
|
||||
NULL, /* free */
|
||||
RTFUNCTAB_FUNC_UV_CAST(rt_annot_uv),
|
||||
RTFUNCTAB_FUNC_CURVE_CAST(rt_annot_curve),
|
||||
RTFUNCTAB_FUNC_CLASS_CAST(rt_generic_class),
|
||||
RTFUNCTAB_FUNC_FREE_CAST(rt_annot_free),
|
||||
NULL, /* plot */
|
||||
NULL, /* adaptive_plot */
|
||||
NULL, /* vshot */
|
||||
NULL, /* tess */
|
||||
NULL, /* tnurb */
|
||||
NULL, /* brep */
|
||||
NULL, /* import5 */
|
||||
NULL, /* export5 */
|
||||
NULL, /* import4 */
|
||||
NULL, /* export4 */
|
||||
NULL, /* ifree */
|
||||
NULL, /* describe */
|
||||
NULL, /* xform */
|
||||
RTFUNCTAB_FUNC_IMPORT5_CAST(rt_annot_import5),
|
||||
RTFUNCTAB_FUNC_EXPORT5_CAST(rt_annot_export5),
|
||||
RTFUNCTAB_FUNC_IMPORT4_CAST(rt_annot_import4),
|
||||
RTFUNCTAB_FUNC_EXPORT4_CAST(rt_annot_export4),
|
||||
RTFUNCTAB_FUNC_IFREE_CAST(rt_annot_ifree),
|
||||
RTFUNCTAB_FUNC_DESCRIBE_CAST(rt_annot_describe),
|
||||
RTFUNCTAB_FUNC_XFORM_CAST(rt_generic_xform),
|
||||
NULL, /* parse */
|
||||
sizeof(struct rt_annotation_internal),
|
||||
RT_ANNOTATION_INTERNAL_MAGIC,
|
||||
NULL, /* get */
|
||||
NULL, /* adjust */
|
||||
NULL, /* form */
|
||||
sizeof(struct rt_annot_internal),
|
||||
RT_ANNOT_INTERNAL_MAGIC,
|
||||
RTFUNCTAB_FUNC_GET_CAST(rt_annot_get),
|
||||
RTFUNCTAB_FUNC_ADJUST_CAST(rt_annot_adjust),
|
||||
RTFUNCTAB_FUNC_FORM_CAST(rt_annot_form),
|
||||
NULL, /* make */
|
||||
NULL, /* params */
|
||||
RTFUNCTAB_FUNC_PARAMS_CAST(rt_annot_params),
|
||||
NULL, /* bbox */
|
||||
NULL, /* volume */
|
||||
NULL, /* surf_area */
|
||||
@@ -2425,6 +2427,9 @@ rt_id_solid(struct bu_external *ep)
|
||||
case DBID_SKETCH:
|
||||
id = ID_SKETCH;
|
||||
break;
|
||||
case DBID_ANNOT:
|
||||
id = ID_ANNOT;
|
||||
break;
|
||||
case DBID_EXTR:
|
||||
id = ID_EXTRUDE;
|
||||
break;
|
||||
|
||||
+1
-1
@@ -1079,7 +1079,7 @@ f_type(struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, str
|
||||
* be updated manually unless/until some functionality is added to generate it */
|
||||
if (!bu_fnmatch(plan->type_data, "shape", 0) &&
|
||||
intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_COMBINATION &&
|
||||
intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_ANNOTATION &&
|
||||
intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_ANNOT &&
|
||||
intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_CONSTRAINT &&
|
||||
intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_GRIP &&
|
||||
intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_JOINT
|
||||
|
||||
Reference in new issue
Block a user