Revision: 76692
http://sourceforge.net/p/brlcad/code/76692
Author: starseeker
Date: 2020-08-10 15:53:38 +0000 (Mon, 10 Aug 2020)
Log Message:
-----------
vlblock feels really wrong as a user facing API. My understanding is that it
exists in order to efficiently organize vlists by color for faster drawing, but
that feels like it should be an implementation detail hidden from the user.
Not sure yet what these concepts 'should' look like...
Modified Paths:
--------------
brlcad/branches/bioh/include/bg/vlist.h
brlcad/branches/bioh/include/dm/bview.h
brlcad/branches/bioh/src/libbg/vlist.cpp
Modified: brlcad/branches/bioh/include/bg/vlist.h
===================================================================
--- brlcad/branches/bioh/include/bg/vlist.h 2020-08-10 14:06:33 UTC (rev
76691)
+++ brlcad/branches/bioh/include/bg/vlist.h 2020-08-10 15:53:38 UTC (rev
76692)
@@ -155,39 +155,6 @@
BG_EXPORT extern int
bg_vlist_bbox(point_t *bmin, point_t *bmax, double *poly_length, struct
bg_vlist *v);
-/* vlblocks associate colors with vlists */
-struct bg_vlblock_impl;
-struct bg_vlblock {
- struct bg_vlblock_impl *i;
-};
-
-/* Create an empty bg_vlblock */
-BG_EXPORT extern struct bg_vlblock *
-bg_vlblock_create();
-
-/* Destroy a bg_vlblock. Does not destroy vlists in the block or
- * their associated queues - to fully clean up bg_vlblock:
- *
- * 1. Find and destroy all vlists in the block.
- * 2. Destroy the bg_vlblock
- * 3. Destroy the bg_vlist_queue(s) in use by the app.
- */
-BG_EXPORT extern void
-bg_vlblock_destroy(struct bg_vlblock *b);
-
-BG_EXPORT extern int
-bg_vlist_set_color(struct bg_vlblock *vb, struct bg_vlist *v, struct bu_color
*c);
-
-BG_EXPORT extern struct bu_color *
-bg_vlist_get_color(struct bg_vlblock *vb, struct bg_vlist *v);
-
-BG_EXPORT extern int
-bg_vlblock_list_colors(struct bu_color **c, struct bg_vlblock *vb);
-
-BG_EXPORT extern int
-bg_vlblock_find(struct bg_vlist **, struct bg_vlblock *vb, struct bu_color *c);
-
-
/**
* Convert a string to a vlist.
*
Modified: brlcad/branches/bioh/include/dm/bview.h
===================================================================
--- brlcad/branches/bioh/include/dm/bview.h 2020-08-10 14:06:33 UTC (rev
76691)
+++ brlcad/branches/bioh/include/dm/bview.h 2020-08-10 15:53:38 UTC (rev
76692)
@@ -33,6 +33,7 @@
#define DM_BVIEW_H
#include "common.h"
+#include "bu/color.h"
#include "bu/list.h"
#include "bu/vls.h"
#include "bu/observer.h"
@@ -254,6 +255,7 @@
size_t gv_bot_threshold;
int gv_hidden;
void *dmp; /* Display manager pointer, if one is
associated with this view */
+ void *objs; /* Stub - intended eventually to point
to an RTree with the bview_objs associated with the view */
void *u_data; /* Caller data associated with this
view */
struct bu_ptbl *callbacks;
};
@@ -270,6 +272,28 @@
void *freesolid;
};
+
+/* Conceptually this is intended to eventually replace parts of struct solid,
+ * bview_solid_data and bn_vlblock. */
+#define BVIEW_OBJ_DEFAULT 0
+#define BVIEW_OBJ_DISABLE 1ULL << 0
+#define BVIEW_OBJ_ILLUM 1ULL << 1
+#define BVIEW_OBJ_DASHED 1ULL << 2
+#define BVIEW_OBJ_WIREFRAME 1ULL << 3
+#define BVIEW_OBJ_SHADED 1ULL << 4
+#define BVIEW_OBJ_HIDDEN_LINE 1ULL << 5
+#define BVIEW_OBJ_TRANSP 1ULL << 6
+
+struct bview_obj {
+ struct bu_vls name; /**< @brief Unique object name */
+ void *shape_data; /**< @brief Associated shape data (usually
vlist) */
+ struct bu_color c; /**< @brief Color used for drawing */
+ unsigned long long flags; /**< @brief Visualization related flags */
+ double transparency; /**< @brief holds a transparency value in the
range [0.0, 1.0] */
+ struct bview *bv; /**< @brief Associated bview (if any) */
+ void *u_data; /**< @brief User data associated with this
object */
+};
+
#endif /* DM_BVIEW_H */
/** @} */
Modified: brlcad/branches/bioh/src/libbg/vlist.cpp
===================================================================
--- brlcad/branches/bioh/src/libbg/vlist.cpp 2020-08-10 14:06:33 UTC (rev
76691)
+++ brlcad/branches/bioh/src/libbg/vlist.cpp 2020-08-10 15:53:38 UTC (rev
76692)
@@ -38,6 +38,8 @@
#include "bg/lseg.h"
#include "bg/vlist.h"
+/* Internal implementation structures */
+
class vobj {
public:
point_t p = VINIT_ZERO;
@@ -49,7 +51,17 @@
std::vector<vobj> objs;
};
+struct bg_vlist_impl {
+ std::vector<size_t> v;
+ struct bg_vlist_queue *q;
+ // If a vlist is not using a queue, the vobjs are
+ // stored locally with the list
+ std::vector<vobj> vlocal;
+};
+
+/* vlist queue functions */
+
struct bg_vlist_queue *
bg_vlist_queue_create()
{
@@ -66,14 +78,9 @@
BU_PUT(q, struct bg_vlist_queue);
}
-struct bg_vlist_impl {
- std::vector<size_t> v;
- struct bg_vlist_queue *q;
- // If a vlist is not using a queue, the vobjs are
- // stored locally with the list
- std::vector<vobj> vlocal;
-};
+/* vlist functions */
+
struct bg_vlist *
bg_vlist_create(struct bg_vlist_queue *q)
{
@@ -101,8 +108,6 @@
BU_PUT(v, struct bg_vlist);
}
-
-
size_t
bg_vlist_npnts(struct bg_vlist *v)
{
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits