Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(15) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(53) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(159) |
Feb
(63) |
Mar
(282) |
Apr
(185) |
May
(228) |
Jun
(404) |
Jul
(376) |
Aug
(260) |
Sep
(891) |
Oct
(302) |
Nov
(338) |
Dec
(430) |
2006 |
Jan
(502) |
Feb
(116) |
Mar
(76) |
Apr
(135) |
May
(52) |
Jun
(134) |
Jul
(252) |
Aug
(355) |
Sep
(71) |
Oct
(36) |
Nov
(10) |
Dec
(22) |
2007 |
Jan
(649) |
Feb
(644) |
Mar
(458) |
Apr
(317) |
May
(519) |
Jun
(196) |
Jul
(201) |
Aug
(139) |
Sep
(504) |
Oct
(491) |
Nov
(749) |
Dec
(702) |
2008 |
Jan
(306) |
Feb
(261) |
Mar
(154) |
Apr
(355) |
May
(296) |
Jun
(420) |
Jul
(509) |
Aug
(389) |
Sep
(211) |
Oct
(304) |
Nov
(159) |
Dec
(180) |
2009 |
Jan
(193) |
Feb
(290) |
Mar
(206) |
Apr
(253) |
May
(220) |
Jun
(372) |
Jul
(534) |
Aug
(400) |
Sep
(322) |
Oct
(242) |
Nov
(374) |
Dec
(360) |
2010 |
Jan
(419) |
Feb
(296) |
Mar
(477) |
Apr
(646) |
May
(554) |
Jun
(284) |
Jul
(211) |
Aug
(412) |
Sep
(493) |
Oct
(313) |
Nov
(286) |
Dec
(416) |
2011 |
Jan
(914) |
Feb
(714) |
Mar
(614) |
Apr
(397) |
May
(177) |
Jun
(640) |
Jul
(382) |
Aug
(778) |
Sep
(484) |
Oct
(370) |
Nov
(340) |
Dec
(464) |
2012 |
Jan
(982) |
Feb
(417) |
Mar
(278) |
Apr
(517) |
May
(424) |
Jun
(580) |
Jul
(358) |
Aug
(605) |
Sep
(257) |
Oct
(809) |
Nov
(519) |
Dec
(197) |
2013 |
Jan
(159) |
Feb
(229) |
Mar
(480) |
Apr
(282) |
May
(348) |
Jun
(283) |
Jul
(495) |
Aug
(960) |
Sep
(648) |
Oct
(381) |
Nov
(330) |
Dec
(522) |
2014 |
Jan
(393) |
Feb
(388) |
Mar
(305) |
Apr
(127) |
May
(593) |
Jun
(444) |
Jul
(508) |
Aug
(476) |
Sep
(595) |
Oct
(196) |
Nov
(310) |
Dec
(277) |
2015 |
Jan
(242) |
Feb
(207) |
Mar
(220) |
Apr
(263) |
May
(324) |
Jun
(380) |
Jul
(302) |
Aug
(344) |
Sep
(240) |
Oct
(177) |
Nov
(156) |
Dec
(82) |
2016 |
Jan
(191) |
Feb
(212) |
Mar
(331) |
Apr
(281) |
May
(215) |
Jun
(192) |
Jul
(308) |
Aug
(248) |
Sep
(178) |
Oct
(233) |
Nov
(60) |
Dec
(48) |
2017 |
Jan
(85) |
Feb
(34) |
Mar
(72) |
Apr
(138) |
May
(139) |
Jun
(72) |
Jul
(95) |
Aug
(143) |
Sep
(171) |
Oct
(32) |
Nov
(81) |
Dec
(95) |
2018 |
Jan
(99) |
Feb
(118) |
Mar
(79) |
Apr
(58) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(12) |
2
(8) |
3
(25) |
4
(9) |
5
(10) |
6
(4) |
7
(12) |
8
(1) |
9
(1) |
10
(14) |
11
(10) |
12
(11) |
13
(13) |
14
(21) |
15
(3) |
16
(2) |
17
(11) |
18
(44) |
19
(26) |
20
(25) |
21
(10) |
22
(4) |
23
(4) |
24
(8) |
25
(16) |
26
(15) |
27
(11) |
28
(10) |
29
(2) |
30
(32) |
31
(26) |
|
|
|
|
|
From: <ralith@us...> - 2009-08-13 22:42:15
|
Revision: 35542 http://brlcad.svn.sourceforge.net/brlcad/?rev=35542&view=rev Author: ralith Date: 2009-08-13 22:42:07 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed argument count checking for a few commands, renamed open to opendb, and tweaked help. Modified Paths: -------------- rt^3/trunk/src/g3d/CommandInterpreter.cxx rt^3/trunk/src/g3d/GedCommands.h Modified: rt^3/trunk/src/g3d/CommandInterpreter.cxx =================================================================== --- rt^3/trunk/src/g3d/CommandInterpreter.cxx 2009-08-13 22:37:28 UTC (rev 35541) +++ rt^3/trunk/src/g3d/CommandInterpreter.cxx 2009-08-13 22:42:07 UTC (rev 35542) @@ -52,7 +52,7 @@ // addCommand(new CommandSetPolygonMode()); // addCommand(new CommandSetCameraProjectionType()); // addCommand(new CommandCycleCameraMode()); - addCommand(new CommandGedOpen()); + addCommand(new CommandGedOpenDB()); addCommand(new CommandGedDump()); addCommand(new CommandGedSolidsOnRay()); addCommand(new CommandGedSummary()); @@ -138,23 +138,20 @@ QStringList args = parseCommandLine(commandLine); QString output; - // extract the command name - QString commandName = args[0]; - - if (commandName == "help") { + if (args[0] == "help") { // help meta command - if (args.empty()) { + if (args.size() < 2) { // general help emit commandDone(help()); } else { // specific command help - emit commandDone(help(commandName)); + emit commandDone(help(args[0])); } } else { // search for a "real" command - Command* command = findCommand(commandName); + Command* command = findCommand(args[0]); if (!command) { - output.append("No such command '" + commandName + "', type 'help' for a list."); + output.append("No such command '" + args[0] + "', type 'help' for a list."); } else { // execute the command output = command->execute(args); Modified: rt^3/trunk/src/g3d/GedCommands.h =================================================================== --- rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 22:37:28 UTC (rev 35541) +++ rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 22:42:07 UTC (rev 35542) @@ -71,11 +71,11 @@ /** @brief Open a database for editing */ -class CommandGedOpen : public GedCommand +class CommandGedOpenDB : public GedCommand { public: - CommandGedOpen() : - GedCommand("open", + CommandGedOpenDB() : + GedCommand("opendb", "Open a database for editing.", "Takes the filename to open") { @@ -117,7 +117,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() != 0) { + if (args.length() != 1) { return CommandMessages::NO_ARGUMENTS; } else { const char* argv[] = { _name.toStdString().c_str() }; @@ -232,7 +232,7 @@ } virtual QString execute(QStringList &args) { - if (args.length() != 0) { + if (args.length() != 1) { return CommandMessages::NO_ARGUMENTS; } else { ged* g = GedData::instance().getGED(); @@ -264,7 +264,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() != 0) { + if (args.length() != 1) { return CommandMessages::NO_ARGUMENTS; } else { return QString(bu_vls_addr(&g->ged_result_str)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ralith@us...> - 2009-08-13 22:37:36
|
Revision: 35541 http://brlcad.svn.sourceforge.net/brlcad/?rev=35541&view=rev Author: ralith Date: 2009-08-13 22:37:28 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed handling of multiline command output. Modified Paths: -------------- rt^3/trunk/src/g3d/Console.cxx Modified: rt^3/trunk/src/g3d/Console.cxx =================================================================== --- rt^3/trunk/src/g3d/Console.cxx 2009-08-13 22:13:32 UTC (rev 35540) +++ rt^3/trunk/src/g3d/Console.cxx 2009-08-13 22:37:28 UTC (rev 35541) @@ -101,10 +101,13 @@ if(str.length() == 0) { return; } - - outputLines.push_back(str); - if(outputLines.size() > CONSOLE_OUTPUT_LINES) { + QStringList lines = str.split("\n"); + for(int i = 0; i < lines.size(); i++) { + outputLines.push_back(lines[i]); + } + + while(outputLines.size() > CONSOLE_OUTPUT_LINES) { outputLines.pop_front(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ralith@us...> - 2009-08-13 22:13:40
|
Revision: 35540 http://brlcad.svn.sourceforge.net/brlcad/?rev=35540&view=rev Author: ralith Date: 2009-08-13 22:13:32 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Dropped ged_ prefix from numerous commands. Modified Paths: -------------- rt^3/trunk/src/g3d/GedCommands.h Modified: rt^3/trunk/src/g3d/GedCommands.h =================================================================== --- rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 22:12:03 UTC (rev 35539) +++ rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 22:13:32 UTC (rev 35540) @@ -45,7 +45,7 @@ { public: CommandGedDump() : - GedCommand("ged_dump", + GedCommand("dump", "Dump a full copy of the database", "Argument is filename ('.g' not added automatically)") { @@ -107,7 +107,7 @@ { public: CommandGedSolidsOnRay() : - GedCommand("ged_solids_on_ray", + GedCommand("solids_on_ray", "Solids on ray", "") { @@ -138,7 +138,7 @@ { public: CommandGedSummary() : - GedCommand("ged_summary", + GedCommand("summary", "Get libged database file summary", "Argument is either empty, or one of [primitives|regions|groups] (initial chars are enough)") { @@ -187,7 +187,7 @@ { public: CommandGedTitle() : - GedCommand("ged_title", + GedCommand("title", "Get/Set libged database title", "Argument is title (empty to get)") { @@ -225,7 +225,7 @@ { public: CommandGedVersion() : - GedCommand("ged_version", + GedCommand("version", "Get libged database file version", "") { @@ -254,7 +254,7 @@ { public: CommandGedZap() : - GedCommand("ged_zap", + GedCommand("zap", "Erase all currently displayed geometry", "") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ralith@us...> - 2009-08-13 22:12:21
|
Revision: 35539 http://brlcad.svn.sourceforge.net/brlcad/?rev=35539&view=rev Author: ralith Date: 2009-08-13 22:12:03 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed command and argument parsing; open appears to now be functional. Modified Paths: -------------- rt^3/trunk/src/g3d/CommandInterpreter.cxx rt^3/trunk/src/g3d/GedCommands.h Modified: rt^3/trunk/src/g3d/CommandInterpreter.cxx =================================================================== --- rt^3/trunk/src/g3d/CommandInterpreter.cxx 2009-08-13 21:56:49 UTC (rev 35538) +++ rt^3/trunk/src/g3d/CommandInterpreter.cxx 2009-08-13 22:12:03 UTC (rev 35539) @@ -52,6 +52,7 @@ // addCommand(new CommandSetPolygonMode()); // addCommand(new CommandSetCameraProjectionType()); // addCommand(new CommandCycleCameraMode()); + addCommand(new CommandGedOpen()); addCommand(new CommandGedDump()); addCommand(new CommandGedSolidsOnRay()); addCommand(new CommandGedSummary()); @@ -139,7 +140,6 @@ // extract the command name QString commandName = args[0]; - args.removeAt(0); if (commandName == "help") { // help meta command @@ -157,8 +157,9 @@ output.append("No such command '" + commandName + "', type 'help' for a list."); } else { // execute the command - emit commandDone(command->execute(args)); + output = command->execute(args); } + emit commandDone(output.size() ? output : "<no output>"); } } Modified: rt^3/trunk/src/g3d/GedCommands.h =================================================================== --- rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 21:56:49 UTC (rev 35538) +++ rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 22:12:03 UTC (rev 35539) @@ -56,7 +56,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() != 1) { + if (args.length() != 2) { return CommandMessages::ONE_ARGUMENT; } else { const char* argv[] = { _name.toStdString().c_str(), args[1].toStdString().c_str() }; @@ -86,7 +86,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() != 1) { + if (args.length() != 2) { return CommandMessages::ONE_ARGUMENT; } else { const char* argv[] = { _name.toStdString().c_str(), args[1].toStdString().c_str() }; @@ -149,7 +149,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() > 1) { + if (args.length() > 2) { return CommandMessages::ZERO_OR_ONE_ARGUMENTS; } else { if (args.length() == 1) { @@ -198,7 +198,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() > 1) { + if (args.length() > 2) { return CommandMessages::ZERO_OR_ONE_ARGUMENTS; } else { if (args.length() == 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ralith@us...> - 2009-08-13 21:57:01
|
Revision: 35538 http://brlcad.svn.sourceforge.net/brlcad/?rev=35538&view=rev Author: ralith Date: 2009-08-13 21:56:49 +0000 (Thu, 13 Aug 2009) Log Message: ----------- First attempt at adding additional GED commands. Uncertain success. Modified Paths: -------------- rt^3/trunk/src/g3d/GedCommands.h Modified: rt^3/trunk/src/g3d/GedCommands.h =================================================================== --- rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 21:50:42 UTC (rev 35537) +++ rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 21:56:49 UTC (rev 35538) @@ -69,6 +69,36 @@ }; +/** @brief Open a database for editing + */ +class CommandGedOpen : public GedCommand +{ +public: + CommandGedOpen() : + GedCommand("open", + "Open a database for editing.", + "Takes the filename to open") + { + _argNames.push_back("filename"); + } + + virtual QString execute(QStringList &args) { + ged* g = GedData::instance().getGED(); + int result = 0; + + if (args.length() != 1) { + return CommandMessages::ONE_ARGUMENT; + } else { + const char* argv[] = { _name.toStdString().c_str(), args[1].toStdString().c_str() }; + int argc = sizeof(argv)/sizeof(const char*); + result = ged_reopen(g, argc, argv); + + return QString(bu_vls_addr(&g->ged_result_str)); + } + } +}; + + /** @brief Solids on ray * * @author Manuel A. Fernandez Montecelo <mafm@...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ralith@us...> - 2009-08-13 21:51:10
|
Revision: 35537 http://brlcad.svn.sourceforge.net/brlcad/?rev=35537&view=rev Author: ralith Date: 2009-08-13 21:50:42 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Scrap unnecessary safeguards Modified Paths: -------------- rt^3/trunk/src/g3d/GedData.h Modified: rt^3/trunk/src/g3d/GedData.h =================================================================== --- rt^3/trunk/src/g3d/GedData.h 2009-08-13 21:09:00 UTC (rev 35536) +++ rt^3/trunk/src/g3d/GedData.h 2009-08-13 21:50:42 UTC (rev 35537) @@ -32,10 +32,6 @@ #include <brlcad/ged.h> -/** \note mafm: Undefining too-common names to not clash with names - * elsewhere (in example, Ogre uses some of them) */ -#undef X -#undef Y #include "../../include/Utility/Singleton.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <erikgreenwald@us...> - 2009-08-13 21:09:07
|
Revision: 35536 http://brlcad.svn.sourceforge.net/brlcad/?rev=35536&view=rev Author: erikgreenwald Date: 2009-08-13 21:09:00 +0000 (Thu, 13 Aug 2009) Log Message: ----------- fast loading of BoT and NMG Modified Paths: -------------- isst/trunk/src/load_g.c Modified: isst/trunk/src/load_g.c =================================================================== --- isst/trunk/src/load_g.c 2009-08-13 20:56:47 UTC (rev 35535) +++ isst/trunk/src/load_g.c 2009-08-13 21:09:00 UTC (rev 35536) @@ -57,39 +57,21 @@ static struct bn_tol tol; /* calculation tolerance */ static tie_t *cur_tie; static struct db_i *dbip; +TIE_3 **tribuf; /* load the region into the tie image */ static void -nmg_to_adrt_internal(struct nmgregion *r, struct db_full_path *pathp, int region_id, int material_id, float color[3]) +nmg_to_adrt_internal(struct adrt_mesh_s *mesh, struct nmgregion *r) { struct model *m; struct shell *s; int region_polys=0; - TIE_3 **buf; - struct adrt_mesh_s *mesh; NMG_CK_REGION(r); - RT_CK_FULL_PATH(pathp); m = r->m_p; NMG_CK_MODEL(m); - buf = (TIE_3 **)bu_malloc(sizeof(TIE_3 *) * 3, "triangle buffer buffer"); - buf[0] = (TIE_3 *)bu_malloc(sizeof(TIE_3) * 3, "triangle buffer"); - buf[1] = (TIE_3 *)bu_malloc(sizeof(TIE_3) * 3, "triangle buffer"); - buf[2] = (TIE_3 *)bu_malloc(sizeof(TIE_3) * 3, "triangle buffer"); - - mesh = BU_GETSTRUCT(mesh, adrt_mesh_s); - - BU_LIST_PUSH(&(isst.meshes->l), &(mesh->l)); - - mesh->texture = NULL; - mesh->flags = 0; - mesh->attributes = (struct adrt_mesh_attributes_s *)bu_malloc(sizeof(struct adrt_mesh_attributes_s), "adrt mesh attributes"); - - VMOVE(mesh->attributes->color.v, color); - strncpy(mesh->name, db_path_to_string(pathp), 255); - /* Check triangles */ for (BU_LIST_FOR (s, shell, &r->s_hd)) { @@ -131,7 +113,7 @@ NMG_CK_VERTEX(v); /* convert mm to m */ - VSCALE((*buf[vert_count]).v, v->vg_p->coord, 1.0/1000.0); + VSCALE((*tribuf[vert_count]).v, v->vg_p->coord, 1.0/1000.0); vert_count++; } if (vert_count > 3) @@ -142,38 +124,77 @@ else if (vert_count < 3) continue; - tie_push(cur_tie, buf, 1, mesh, 0); + tie_push(cur_tie, tribuf, 1, mesh, 0); region_polys++; } } } - bu_free(buf[0], "vert"); - bu_free(buf[1], "vert"); - bu_free(buf[2], "vert"); - bu_free(buf, "tri"); /* region_name must not be freed until we're done with the tie engine. */ } int -nmg_to_adrt_regstart(struct db_tree_state *ts, struct db_full_path *path, const struct rt_comb_internal *rci, genptr_t client_data) { +nmg_to_adrt_regstart(struct db_tree_state *ts, struct db_full_path *path, const struct rt_comb_internal *rci, genptr_t client_data) +{ /* * if it's a simple single bot region, just eat the bots and return -1. - * Omnomnom. + * Omnomnom. Return 0 to do nmg eval. */ struct directory *dir; + struct rt_db_internal intern; + struct rt_bot_internal *bot; + struct adrt_mesh_s *mesh; + RT_CHECK_COMB(rci); if(rci->tree == NULL) - return -1; + return 0; RT_CK_TREE(rci->tree); if( rci->tree->tr_op != OP_DB_LEAF ) return 0; dir = db_lookup(dbip, rci->tree->tr_l.tl_name, 1); - if(dir->d_minor_type != ID_BOT) + if(dir->d_minor_type != ID_BOT && dir->d_minor_type != ID_NMG) return 0; - printf("%s is a bot, do magic here.\n", dir->d_namep); + printf("%s is a bot/nmg, do magic here.\n", dir->d_namep); + if(rt_db_get_internal(&intern, dir, dbip, (fastf_t *)NULL, &rt_uniresource) < 0) { + printf("Failed to load\n"); + return 0; + } + mesh = BU_GETSTRUCT(mesh, adrt_mesh_s); + + BU_LIST_PUSH(&(isst.meshes->l), &(mesh->l)); + + mesh->texture = NULL; + mesh->flags = 0; + mesh->attributes = (struct adrt_mesh_attributes_s *)bu_malloc(sizeof(struct adrt_mesh_attributes_s), "adrt mesh attributes"); + + /* + VMOVE(mesh->attributes->color.v, color); + */ + strncpy(mesh->name, db_path_to_string(path), 255); + printf("%s fastloaded\n", mesh->name); + + if(intern.idb_minor_type == ID_NMG) { + nmg_to_adrt_internal(mesh, (struct nmgregion *)intern.idb_ptr); + return -1; + } else if (intern.idb_minor_type == ID_BOT) { + struct rt_bot_internal *bot = intern.idb_ptr; + int i; + + RT_BOT_CK_MAGIC(bot); + + for(i=0;i<bot->num_faces;i++) + { + VSCALE((*tribuf[0]).v, &bot->vertices[3*bot->faces[i+0]], 1.0/1000.0); + VSCALE((*tribuf[1]).v, &bot->vertices[3*bot->faces[i+1]], 1.0/1000.0); + VSCALE((*tribuf[2]).v, &bot->vertices[3*bot->faces[i+2]], 1.0/1000.0); + tie_push(cur_tie, tribuf, 1, mesh, 0); + } + return -1; + } + + bu_log("Strange, %d is not %d or %d\n", ID_BOT, ID_NMG); return 0; } @@ -182,8 +203,6 @@ { struct model *m; struct shell *s; - int region_polys=0; - TIE_3 **buf; struct adrt_mesh_s *mesh; NMG_CK_REGION(r); @@ -195,7 +214,18 @@ /* triangulate model */ nmg_triangulate_model(m, &tol); - nmg_to_adrt_internal(r, pathp, region_id, material_id, color); + mesh = BU_GETSTRUCT(mesh, adrt_mesh_s); + + BU_LIST_PUSH(&(isst.meshes->l), &(mesh->l)); + + mesh->texture = NULL; + mesh->flags = 0; + mesh->attributes = (struct adrt_mesh_attributes_s *)bu_malloc(sizeof(struct adrt_mesh_attributes_s), "adrt mesh attributes"); + + VMOVE(mesh->attributes->color.v, color); + strncpy(mesh->name, db_path_to_string(pathp), 255); + + nmg_to_adrt_internal(mesh, r); } int @@ -257,6 +287,11 @@ BU_GETSTRUCT(isst.meshes, adrt_mesh_s); BU_LIST_INIT(&(isst.meshes->l)); + tribuf = (TIE_3 **)bu_malloc(sizeof(TIE_3 *) * 3, "triangle tribuffer tribuffer"); + tribuf[0] = (TIE_3 *)bu_malloc(sizeof(TIE_3) * 3, "triangle tribuffer"); + tribuf[1] = (TIE_3 *)bu_malloc(sizeof(TIE_3) * 3, "triangle tribuffer"); + tribuf[2] = (TIE_3 *)bu_malloc(sizeof(TIE_3) * 3, "triangle tribuffer"); + (void) db_walk_tree(dbip, argc, /* number of toplevel regions */ argv, /* region names */ @@ -271,6 +306,10 @@ nmg_km(the_model); rt_vlist_cleanup(); db_close(dbip); + bu_free(tribuf[0], "vert"); + bu_free(tribuf[1], "vert"); + bu_free(tribuf[2], "vert"); + bu_free(tribuf, "tri"); tie_prep(cur_tie); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <n_reed@us...> - 2009-08-13 20:57:00
|
Revision: 35535 http://brlcad.svn.sourceforge.net/brlcad/?rev=35535&view=rev Author: n_reed Date: 2009-08-13 20:56:47 +0000 (Thu, 13 Aug 2009) Log Message: ----------- removed some unecessary type conversions Modified Paths: -------------- brlcad/trunk/src/libdm/dm-rtgl.c Modified: brlcad/trunk/src/libdm/dm-rtgl.c =================================================================== --- brlcad/trunk/src/libdm/dm-rtgl.c 2009-08-13 20:24:46 UTC (rev 35534) +++ brlcad/trunk/src/libdm/dm-rtgl.c 2009-08-13 20:56:47 UTC (rev 35535) @@ -1345,7 +1345,7 @@ bu_log("adding %d x %d jobs", uDivs, vDivs); -#if 1 +#if 0 uDivs /= 2; vDivs /= 2; #endif @@ -1412,7 +1412,7 @@ bu_free(currJob, "free jobs currJob"); (void)rt_get_timer( (struct bu_vls *)0, &elapsed_time); - if (elapsed_time > 0.1) /* 100ms */ + if (elapsed_time > .1) /* 100ms */ return 0; } @@ -1422,7 +1422,7 @@ return 1; } -void drawPoints(fastf_t *view, int pointSize) { +void drawPoints(float *view, int pointSize) { glPointSize(pointSize); #if 0 /* use vertex arrays */ @@ -1430,8 +1430,8 @@ glEnableClientState(GL_NORMAL_ARRAY); #endif int i, numPoints, index, count = 0; - vect_t normal; - double dot; + float normal[3]; + float dot; for (BU_LIST_FOR(currItem, ptInfoList, &(ptInfo.l))) { @@ -1458,8 +1458,8 @@ #endif /* draw if visible */ if (dot > 0) { - glNormal3d(normal[X], normal[Y], normal[Z]); - glVertex3d(currItem->points[X + index], currItem->points[Y + index], currItem->points[Z + index]); + glNormal3f(normal[X], normal[Y], normal[Z]); + glVertex3f(currItem->points[X + index], currItem->points[Y + index], currItem->points[Z + index]); } } glEnd(); @@ -1812,7 +1812,11 @@ pointSize = 1; } - drawPoints(view, pointSize); + float fview[3]; + + VMOVE(fview, view); + + drawPoints(fview, pointSize); if (!jobsDone) { RTGL_DIRTY = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jdoliner@us...> - 2009-08-13 20:24:58
|
Revision: 35534 http://brlcad.svn.sourceforge.net/brlcad/?rev=35534&view=rev Author: jdoliner Date: 2009-08-13 20:24:46 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Changes SurfaceSurface intersect into FaceFaceIntersect and uses the new Face_X_Event class to return its results Modified Paths: -------------- brlcad/trunk/src/proc-db/surfaceintersect.cpp Modified: brlcad/trunk/src/proc-db/surfaceintersect.cpp =================================================================== --- brlcad/trunk/src/proc-db/surfaceintersect.cpp 2009-08-13 19:50:55 UTC (rev 35533) +++ brlcad/trunk/src/proc-db/surfaceintersect.cpp 2009-08-13 20:24:46 UTC (rev 35534) @@ -187,13 +187,13 @@ } /** - * Curve_X_Profile::Compare_start + * Curve_Compare_start * * @Compares the start points of the curve profiles */ -int Curve_X_Profile::Compare_start( - const Curve_X_Profile *a, - const Curve_X_Profile *b +int Curve_Compare_start( + const ON_Curve *a, + const ON_Curve *b ) { ON_3dVector A = ON_2dVector(a->PointAtStart().x, a->PointAtStart().y); @@ -214,13 +214,13 @@ } /** - * Curve_X_Profile::Compare_end + * Curve_Compare_end * * @Compares the end points of the curve profiles */ -int Curve_X_Profile::Compare_end( - const Curve_X_Profile *a, - const Curve_X_Profile *b +int Curve_Compare_end( + const ON_Curve *a, + const ON_Curve *b ) { ON_3dVector A = ON_2dVector(a->PointAtEnd().x, a->PointAtEnd().y); @@ -637,21 +637,21 @@ /** - * SurfaceSurfaceIntersect + * FaceFaceIntersect * - * @brief finds, as bezier curves in the surfaces's parameter spaces the curves of intersection of the two surfaces + * @brief finds the intersection curves of two faces and returns them as Face_X_Events */ -int SurfaceSurfaceIntersect( - const ON_Surface *surf1, - const ON_Surface *surf2, +int FaceFaceIntersect( + ON_BrepFace *face1, + ON_BrepFace *face2, double stepsize, double tol, - ON_ClassArray<ON_Curve*>& curves1, - ON_ClassArray<ON_Curve*>& curves2 + ON_ClassArray<Face_X_Event>& x ) { - int rv = 0; + int init_count = x.Count(); + const ON_Surface *surf1 = face1->SurfaceOf(), *surf2 = face2->SurfaceOf(); ON_2dPointArray start_points1, start_points2; bool rv_edges = GetStartPointsEdges(surf1, surf2, start_points1, start_points2, tol); bool rv_internal = GetStartPointsInternal(surf1, surf2, start_points1, start_points2, tol); @@ -676,14 +676,11 @@ j--; } } - curves1.Append(out1); - curves2.Append(out2); - rv++; + x.Append(Face_X_Event(face1, face2, out1, out2)); } - return rv; + return x.Count() - init_count; } - /** * BrepBrepIntersect * @@ -699,16 +696,12 @@ ) { int i, j, k; - /* first we intersect all of the surfaces and record the intersectiosn in Surface_X_Events */ + /* first we intersect all of the Faces and record the intersectiosn in Surface_X_Events */ ON_ClassArray<Face_X_Event> x; for (i = 0; i < brep1->m_F.Count(); i++) { for (j = 0; j < brep2->m_F.Count(); j++) { - ON_ClassArray<ON_Curve*> curves1, curves2; - int initCount1 = brep1->m_F.Count(), initCount2 = brep2->m_F.Count(); - int new_xs = SurfaceSurfaceIntersect(brep1->m_F[i].SurfaceOf(), brep2->m_F[j].SurfaceOf(), stepsize, tol, curves1, curves2); - for (k = 0; k < new_xs; k++) { - x.Append(Face_X_Event(&brep1->m_F[i], &brep2->m_F[j], curves1[k], curves2[k])); - } + x.Empty(); + int new_xs = FaceFaceIntersect(&brep1->m_F[i], &brep2->m_F[j], stepsize, tol, x); } } for (i = 0; i < x.Count(); i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jdoliner@us...> - 2009-08-13 19:51:03
|
Revision: 35533 http://brlcad.svn.sourceforge.net/brlcad/?rev=35533&view=rev Author: jdoliner Date: 2009-08-13 19:50:55 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Adds a new class to keep track of intersections between ON_BrepFaces. These classes record the intersection curves, segment the curves based on the trimming curves of the faces they came from, and slates the trim curves that got intersected for destruction. Also adds in the functionality needed to sort curves by start and end point and so that they can be matched and reconstructed in to trims. Modified Paths: -------------- brlcad/trunk/src/proc-db/brep_cube.cpp brlcad/trunk/src/proc-db/surfaceintersect.cpp brlcad/trunk/src/proc-db/surfaceintersect.h Modified: brlcad/trunk/src/proc-db/brep_cube.cpp =================================================================== --- brlcad/trunk/src/proc-db/brep_cube.cpp 2009-08-13 18:55:42 UTC (rev 35532) +++ brlcad/trunk/src/proc-db/brep_cube.cpp 2009-08-13 19:50:55 UTC (rev 35533) @@ -69,7 +69,7 @@ /* Prevent enum conflict with vmath.h */ -namespace { +namespace { enum { A, B, C, D, E, F, G, H Modified: brlcad/trunk/src/proc-db/surfaceintersect.cpp =================================================================== --- brlcad/trunk/src/proc-db/surfaceintersect.cpp 2009-08-13 18:55:42 UTC (rev 35532) +++ brlcad/trunk/src/proc-db/surfaceintersect.cpp 2009-08-13 19:50:55 UTC (rev 35533) @@ -90,9 +90,9 @@ ON_3dVector Norm2 = surf2->NormalAt(*s2, *t2); ON_3dVector step = ON_CrossProduct(Norm1, Norm2); double Magnitude = ON_ArrayMagnitude(3, step); - double vec[3] = {0.0, 0.0, 0.0}; - ON_3dVector stepscaled = vec; - ON_ArrayScale(3, safesqrt(stepsize/Magnitude), step, stepscaled); + /* double vec[3] = {0.0, 0.0, 0.0}; */ + ON_3dVector stepscaled; + ON_ArrayScale(3, stepsize/Magnitude, step, stepscaled); Push(surf1, s1, t1, stepscaled); Push(surf2, s2, t2, stepscaled); } @@ -125,32 +125,7 @@ return surf1->PointAt(*s1, *t1).DistanceTo(surf2->PointAt(*s2, *t2)); } -/** - * FaceLoopIntersect - * - * @brief Intersects a new curve in the face's domain with the - * existing loops returns the number of intersections - */ -int FaceLoopIntersect( - ON_BrepFace& face, - ON_Curve *curve, - ON_SimpleArray<ON_X_EVENT>& x, - double tol - ) -{ - int i, j; - int rv = 0; - for (i = 0; i < face.LoopCount(); i++) { - ON_BrepLoop* loop = face.Loop(i); - for (j = 0; j < loop->TrimCount(); j++) { - ON_BrepTrim *trim = loop->Trim(j); - rv += trim->IntersectCurve(curve, x, tol, tol); - } - } -} - - /** * SplitTrim * @@ -165,31 +140,67 @@ ON_Curve *left, *right; bool rv = trim->Split(t, left, right); if (rv) { - trim->Brep()->AddTrimCurve(left); - trim->Brep()->AddTrimCurve(right); + int lefti = trim->Brep()->AddTrimCurve(left); + int righti = trim->Brep()->AddTrimCurve(right); + trim->Loop()->m_ti.Remove(trim->m_trim_index); + trim->Loop()->m_ti.Insert(lefti, trim->m_trim_index); + trim->Loop()->m_ti.Insert(righti, trim->m_trim_index); } - /* now we need to remove the original trim */ - /* it's not quite clear what we'll be doing after that at this point */ } /** - * TrimCompareStart + * ShatterLoop * - * @brief sorts the trims by their start points, uses a pretty convoluted method to get a - * complete ordering on R^3, but you don't actually need to understand the ordering, - * any ordering would work just as well. + * @brief after slicing a loop up in to pieces, this destroys the loop itself + * and drops the pieces into an array */ -int TrimCompareStart( - const ON_BrepTrim *a, - const ON_BrepTrim *b +void ShatterLoop( + ON_BrepLoop *loop, + ON_ClassArray<ON_Curve*> curves ) { - ON_3dVector A = ON_3dVector(a->Face()->SurfaceOf()->PointAt(a->PointAtStart().x, a->PointAtStart().y)); - ON_3dVector B = ON_3dVector(b->Face()->SurfaceOf()->PointAt(b->PointAtStart().x, b->PointAtStart().y)); - if (VAPPROXEQUAL(A, B, 1e-9)) { + int i; + for (i = 0; i < loop->TrimCount(); i++) { + curves.Append(loop->Trim(i)->TrimCurveOf()->Duplicate()); + } + /* deletes the loop as well as curves used only by this loop */ + loop->Brep()->DeleteLoop(*loop, true); +} + +/** + * Compare_X_Parameter + * + * @Compares two ON_X_EVENTS by the value of the parameter of the first curve + */ +int Compare_X_Parameter( + const ON_X_EVENT *a, + const ON_X_EVENT *b + ) +{ + if (a->m_a[0] < b->m_a[0]) { + return -1; + } else if (a->m_a[0] > b->m_a[0]) { + return 1; + } else { return 0; } - else if (A.x < B.x) { +} + +/** + * Curve_X_Profile::Compare_start + * + * @Compares the start points of the curve profiles + */ +int Curve_X_Profile::Compare_start( + const Curve_X_Profile *a, + const Curve_X_Profile *b + ) +{ + ON_3dVector A = ON_2dVector(a->PointAtStart().x, a->PointAtStart().y); + ON_3dVector B = ON_2dVector(b->PointAtStart().x, b->PointAtStart().y); + if (V2APPROXEQUAL(A, B, 1e-9)) { + return 0; + } else if (A.x < B.x) { return -1; } else if (A.x > B.x) { return 1; @@ -197,32 +208,26 @@ return -1; } else if (A.y > B.y) { return 1; - } else if (A.z < B.z) { - return -1; - } else if (A.z > B.z) { - return 1; } else { return 0; /* we should have already done this... but just in case */ } } /** - * TrimCompareEnd + * Curve_X_Profile::Compare_end * - * @brief same as the function above but this one does things with end points - * it's a bit :( that we need to duplicate this code. + * @Compares the end points of the curve profiles */ -int TrimCompareEnd( - const ON_BrepTrim *a, - const ON_BrepTrim *b +int Curve_X_Profile::Compare_end( + const Curve_X_Profile *a, + const Curve_X_Profile *b ) { - ON_3dVector A = ON_3dVector(a->Face()->SurfaceOf()->PointAt(a->PointAtEnd().x, a->PointAtEnd().y)); - ON_3dVector B = ON_3dVector(b->Face()->SurfaceOf()->PointAt(b->PointAtEnd().x, b->PointAtEnd().y)); - if (VAPPROXEQUAL(A, B, 1e-9)) { + ON_3dVector A = ON_2dVector(a->PointAtEnd().x, a->PointAtEnd().y); + ON_3dVector B = ON_2dVector(b->PointAtEnd().x, b->PointAtEnd().y); + if (V2APPROXEQUAL(A, B, 1e-9)) { return 0; - } - else if (A.x < B.x) { + } else if (A.x < B.x) { return -1; } else if (A.x > B.x) { return 1; @@ -230,16 +235,154 @@ return -1; } else if (A.y > B.y) { return 1; - } else if (A.z < B.z) { - return -1; - } else if (A.z > B.z) { - return 1; } else { return 0; /* we should have already done this... but just in case */ } } /** + * Face_X_Event::Face_X_Event + * + * @brief create a new unintialized Face_X_Event + */ +Face_X_Event::Face_X_Event() +{} + +/** + * Face_X_Event::Face_X_Event + * + * @brief create a new Face_X_Event using a set of given values + */ +Face_X_Event::Face_X_Event( + ON_BrepFace *face1, + ON_BrepFace *face2, + ON_Curve *curve1, + ON_Curve *curve2 + ) +{ + Face_X_Event *event = new Face_X_Event; + event->face1 = face1; + event->face2 = face2; + event->curve1 = curve1; + event->curve2 = curve2; + event->loop_flags1.SetCount(face1->LoopCount()); + event->loop_flags2.SetCount(face2->LoopCount()); +} + +/** + * ON_X_EVENT::ON_X_EVENT + * + * @brief create a new ON_X_EVENT This is implemented in opennurbs_x.cpp:19, not sure why the + * compiler is failing to see it + */ +ON_X_EVENT::ON_X_EVENT() +{ + memset(this, 0, sizeof(*this)); +} + +/** + * Curve_X_Profile::Render_Curves + * + * @Renders the Curve in the Curve_X_Profile, as the different curves it is segmented in to + * This assumes the convention that to the left of a curve is below. i.e + */ +int Face_X_Event::Render_Curves() +{ + bool active1 = false, active2 = false; /* the curve can be active or inactive in either face */ + double last; + int i; + /* Now we step through the X events activating and deactivating the curve + * Note the curve is always curve1 in the event, while the trim is always + * curve 2 + */ + for (i = 0; i < x.Count(); i++) { + ON_X_EVENT event = x[i]; + if (active1 && active2) { + /* to be deactived the curve must pass from below a curve to above it */ + if (event.m_dirA[0] == event.from_below_dir && event.m_dirA[1] == event.to_above_dir) { + ON_Curve *new_curve1 = curve1->Duplicate(); + ON_Curve *new_curve2 = curve2->Duplicate(); + new_curve1->Trim(ON_Interval(last, event.m_a[0])); + new_curve2->Trim(ON_Interval(last, event.m_a[0])); + new_curves1.Append(new_curve1); + new_curves2.Append(new_curve2); + last = event.m_a[0]; + if (event.m_user.i == 0) { /* event.m_user tells us which of the twins the event happened in */ + active1 = false; + } else if (event.m_user.i == 1) { + active2 = false; + } else { + assert(0); + } + } else if (event.m_dirA[0] == event.from_above_dir && event.m_dirA[1] == event.to_below_dir) { + /* this would be an activating event, except that both curves are already active + * in this case we assume that the user forgot to remove the outer curve, thus + * we reset last + */ + last = event.m_a[0]; + } + } else { + /* one of the curves is inactive */ + if (event.m_dirA[0] == event.from_above_dir && event.m_dirA[1] == event.to_below_dir) { + last = event.m_a[0]; + if (event.m_user.i == 0) { + active1 = true; + } else if (event.m_user.i == 1) { + active2 = true; + } else { + assert(0); + } + } else { + /* do nothing */ + } + } + } +} + + +/** + * Face_X_Event::Get_ON_X_Events() + * + * @brief Returns all of the intersections between either of the new curves and the trims of the faces + */ +int Face_X_Event::Get_ON_X_Events(double tol) +{ + assert(curve1->SetDomain(Canonical_start, Canonical_end)); /* Make sure curves have the same domain */ + assert(curve2->SetDomain(Canonical_start, Canonical_end)); /* and all the good numbers are in [0, 1] anyways */ + ON_SimpleArray<ON_X_EVENT> out; + x.Empty(); + ON_BrepFace *faces[2] = {face1, face2}; + ON_Curve *curves[2] = {curve1, curve2}; + ON_ClassArray<bool> *loop_flags[2]= {&loop_flags1, &loop_flags2}; + int i, j, k, l; + for (i = 0; i < 2; i++) { + ON_BrepFace *face = faces[i]; + for (j = 0; j < face->LoopCount(); j++) { + ON_BrepLoop* loop = face->Loop(i); + for (k = 0; k < loop->TrimCount(); k++) { + ON_BrepTrim *trim = loop->Trim(j); + out.Empty(); + /* It's worth noting that trims are always curve2 in intersections */ + int new_xs = curves[i]->IntersectCurve(trim->TrimCurveOf(), out, tol, tol); + if (new_xs) { + loop_flags[i][j] = true; /* flag loop j for destruction */ + } + /* record in m_user which curve this intersection came from */ + for (l = 0; l < new_xs; l++) { + out[l].m_user.i = i; + } + /* ON_SetCurveCurveIntersectionDir(ON_3dVector(0.0, 0.0, 1.0), new_xs, out.Array(), Canonical_start, Canonical_end, Canonical_start, Canonical_end); */ + x.Append(new_xs, out.Array()); + } + } + } + if (x.Count()) { + x.QuickSort(Compare_X_Parameter); + } + return x.Count(); +} + +/** * MakeLoops * * @brief Makes loops out of the new trims @@ -294,6 +437,7 @@ } else { return false; } + return false; } /** @@ -304,8 +448,8 @@ */ void WalkIntersection( - ON_Surface *surf1, - ON_Surface *surf2, + const ON_Surface *surf1, + const ON_Surface *surf2, double s1, double s2, double t1, @@ -367,6 +511,9 @@ s2 = inits2; t1 = initt1; t2 = initt2; + if (passes == 0) { + Step(surf1, surf2, &s1, &s2, &t1, &t2, -stepsize); /* to avoid duplicates of the starting point */ + } } } *out1 = (ON_Curve *) new ON_BezierCurve((ON_2dPointArray) intersectionPoints1); @@ -380,9 +527,9 @@ * points internal to the surfaces */ -bool GetStartPoints( - ON_Surface *surf1, - ON_Surface *surf2, +bool GetStartPointsInternal( + const ON_Surface *surf1, + const ON_Surface *surf2, ON_2dPointArray& start_points1, ON_2dPointArray& start_points2, double tol @@ -415,7 +562,7 @@ return_value = false; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { - return_value = return_value && GetStartPoints(Parts1[i], Parts2[j], start_points1, start_points2, tol); + return_value = return_value && GetStartPointsInternal(Parts1[i], Parts2[j], start_points1, start_points2, tol); } } } @@ -428,8 +575,8 @@ * @brief Find starting points that are on the edges of the surfaces */ bool GetStartPointsEdges( - ON_Surface *surf1, - ON_Surface *surf2, + const ON_Surface *surf1, + const ON_Surface *surf2, ON_2dPointArray& start_points1, ON_2dPointArray& start_points2, double tol @@ -441,7 +588,7 @@ intervals[1] = surf1->Domain(1); intervals[2] = surf2->Domain(0); intervals[3] = surf2->Domain(1); - ON_Surface *surfaces[2] = {surf1, surf2}; + const ON_Surface *surfaces[2] = {surf1, surf2}; ON_2dPointArray out[2] = {start_points1, start_points2}; ON_SimpleArray<ON_X_EVENT> x; surf1->IsoCurve(1, intervals[0].Min())->IntersectSurface(surf2, x, tol, tol); @@ -495,18 +642,20 @@ * @brief finds, as bezier curves in the surfaces's parameter spaces the curves of intersection of the two surfaces */ -bool SurfaceSurfaceIntersect( - ON_Surface *surf1, - ON_Surface *surf2, +int SurfaceSurfaceIntersect( + const ON_Surface *surf1, + const ON_Surface *surf2, double stepsize, double tol, - ON_ClassArray<ON_Curve>& curves1, - ON_ClassArray<ON_Curve>& curves2 + ON_ClassArray<ON_Curve*>& curves1, + ON_ClassArray<ON_Curve*>& curves2 ) { + int rv = 0; ON_2dPointArray start_points1, start_points2; - bool rv = GetStartPoints(surf1, surf2, start_points1, start_points2, tol); - if (!rv) { + bool rv_edges = GetStartPointsEdges(surf1, surf2, start_points1, start_points2, tol); + bool rv_internal = GetStartPointsInternal(surf1, surf2, start_points1, start_points2, tol); + if (!(rv_edges || rv_internal)) { return false; } int i, j; @@ -518,23 +667,107 @@ WalkIntersection(surf1, surf2, start1[0], start2[0], start1[1], start2[1], stepsize, tol, &out1, &out2); start_points1.Remove(0); start_points2.Remove(0); - for (j = 1; j < start_points1.Count(); j++) { - ON_3dPoint p1 = surf1->PointAt(start_points1[j][0], start_points1[j][1]); - ON_3dPoint p2 = surf2->PointAt(start_points2[j][0], start_points2[j][1]); + for (j = 0; j < start_points1.Count(); j++) { double dummy; - if (false /* we need to rewrite this test */) { + if (out1->GetClosestPoint(ON_3dPoint(start_points1[j]), &dummy, stepsize) && out2->GetClosestPoint(ON_3dPoint(start_points2[j]), &dummy, stepsize)) { + /* start points j lie on the curve so we delete them */ start_points1.Remove(j); start_points2.Remove(j); j--; } } - /* append the found curves to curves1 and curves2 */ + curves1.Append(out1); + curves2.Append(out2); + rv++; } - return true; + return rv; } + +/** + * BrepBrepIntersect + * + * @brief calls SurfaceSurfaceIntersect on the {m_S}X{m_S} then intersects the results with the trim curves of the + * brepfaces + */ +bool BrepBrepIntersect( + ON_Brep *brep1, + ON_Brep *brep2, + ON_Brep **out, + double stepsize, + double tol + ) +{ + int i, j, k; + /* first we intersect all of the surfaces and record the intersectiosn in Surface_X_Events */ + ON_ClassArray<Face_X_Event> x; + for (i = 0; i < brep1->m_F.Count(); i++) { + for (j = 0; j < brep2->m_F.Count(); j++) { + ON_ClassArray<ON_Curve*> curves1, curves2; + int initCount1 = brep1->m_F.Count(), initCount2 = brep2->m_F.Count(); + int new_xs = SurfaceSurfaceIntersect(brep1->m_F[i].SurfaceOf(), brep2->m_F[j].SurfaceOf(), stepsize, tol, curves1, curves2); + for (k = 0; k < new_xs; k++) { + x.Append(Face_X_Event(&brep1->m_F[i], &brep2->m_F[j], curves1[k], curves2[k])); + } + } + } + for (i = 0; i < x.Count(); i++) { + + } +} + +namespace { + +enum { + A, B, C, D, E, F, G, H +}; + +enum { + AB, BC, CD, AD, EF, FG, GH, EH +}; + +enum { + ABCD, FEHG +}; + +ON_Curve* +TwistedCubeEdgeCurve( const ON_3dPoint& from, const ON_3dPoint& to) +{ + // creates a 3d line segment to be used as a 3d curve in an ON_Brep + ON_Curve* c3d = new ON_LineCurve( from, to ); + c3d->SetDomain( 0.0, 1.0 ); // XXX is this UV bounds? + return c3d; +} + +void +MakeTwistedCubeEdge(ON_Brep& brep, int from, int to, int curve) +{ + ON_BrepVertex& v0 = brep.m_V[from]; + ON_BrepVertex& v1 = brep.m_V[to]; + ON_BrepEdge& edge = brep.NewEdge(v0,v1,curve); + edge.m_tolerance = 0.0; // exact! +} + +void +MakeTwistedCubeEdges1(ON_Brep& brep) +{ + MakeTwistedCubeEdge(brep, A, B, AB); + MakeTwistedCubeEdge(brep, B, C, BC); + MakeTwistedCubeEdge(brep, C, D, CD); + MakeTwistedCubeEdge(brep, A, D, AD); +} + +void +MakeTwistedCubeEdges2(ON_Brep& brep) +{ + MakeTwistedCubeEdge(brep, E, F, EF); + MakeTwistedCubeEdge(brep, F, G, FG); + MakeTwistedCubeEdge(brep, G, H, GH); + MakeTwistedCubeEdge(brep, E, H, EH); +} + ON_Surface* -Surface(const ON_3dPoint& SW, const ON_3dPoint& SE, const ON_3dPoint& NE, const ON_3dPoint& NW) +TwistedCubeSideSurface(const ON_3dPoint& SW, const ON_3dPoint& SE, const ON_3dPoint& NE, const ON_3dPoint& NW) { ON_NurbsSurface* pNurbsSurface = new ON_NurbsSurface(3, // dimension FALSE, // not rational @@ -557,10 +790,285 @@ return pNurbsSurface; } +ON_Curve* +TwistedCubeTrimmingCurve(const ON_Surface& s, + int side // 0 = SW to SE, 1 = SE to NE, 2 = NE to NW, 3 = NW, SW + ) +{ + // a trimming curve is a 2d curve whose image lies in the surface's + // domain. The "active" portion of the surface is to the left of the + // trimming curve (looking down the orientation of the curve). An + // outer trimming loop consists of a simple closed curve running + // counter-clockwise around the region it trims + + ON_2dPoint from, to; + double u0, u1, v0, v1; + s.GetDomain(0, &u0, &u1); + s.GetDomain(1, &v0, &v1); + + switch (side) { + case 0: + from.x = u0; from.y = v0; + to.x = u1; to.y = v0; + break; + case 1: + from.x = u1; from.y = v0; + to.x = u1; to.y = v1; + break; + case 2: + from.x = u1; from.y = v1; + to.x = u0; to.y = v1; + break; + case 3: + from.x = u0; from.y = v1; + to.x = u0; to.y = v0; + break; + default: + return NULL; + } + ON_Curve* c2d = new ON_LineCurve(from,to); + c2d->SetDomain(0.0,1.0); + return c2d; +} + + +int // return value not used? +MakeTwistedCubeTrimmingLoop(ON_Brep& brep, + ON_BrepFace& face, + int v0, int v1, int v2, int v3, // indices of corner vertices + int e0, int eo0, // edge index + orientation w.r.t surface trim + int e1, int eo1, + int e2, int eo2, + int e3, int eo3) +{ + // get a reference to the surface + const ON_Surface& srf = *brep.m_S[face.m_si]; + + ON_BrepLoop& loop = brep.NewLoop(ON_BrepLoop::outer, face); + + // create the trimming curves running counter-clockwise around the + // surface's domain, start at the south side + ON_Curve* c2; + int c2i, ei = 0, bRev3d = 0; + ON_2dPoint q; + + // flags for isoparametric curves + ON_Surface::ISO iso = ON_Surface::not_iso; + + for (int side = 0; side < 4; side++) { + // side: 0=south, 1=east, 2=north, 3=west + c2 = TwistedCubeTrimmingCurve( srf, side ); + c2i = brep.m_C2.Count(); + brep.m_C2.Append(c2); + + switch (side) { + case 0: + ei = e0; + bRev3d = (eo0 == -1); + iso = ON_Surface::S_iso; + break; + case 1: + ei = e1; + bRev3d = (eo1 == -1); + iso = ON_Surface::E_iso; + break; + case 2: + ei = e2; + bRev3d = (eo2 == -1); + iso = ON_Surface::N_iso; + break; + case 3: + ei = e3; + bRev3d = (eo3 == -1); + iso = ON_Surface::W_iso; + break; + } + + ON_BrepTrim& trim = brep.NewTrim(brep.m_E[ei], bRev3d, loop, c2i); + trim.m_iso = iso; + + // the type gives metadata on the trim type in this case, "mated" + // means the trim is connected to an edge, is part of an + // outer/inner/slit loop, no other trim from the same edge is + // connected to the edge, and at least one trim from a different + // loop is connected to the edge + trim.m_type = ON_BrepTrim::mated; // i.e. this b-rep is closed, so + // all trims have mates + + // not convinced these shouldn't be set with a member function + trim.m_tolerance[0] = 0.0; // exact + trim.m_tolerance[1] = 0.0; // + } + return loop.m_loop_index; +} + +void +MakeTwistedCubeFace(ON_Brep& brep, + int surf, + int orientation, + int v0, int v1, int v2, int v3, // the indices of corner vertices + int e0, int eo0, // edge index + orientation + int e1, int eo1, + int e2, int eo2, + int e3, int eo3) +{ + ON_BrepFace& face = brep.NewFace(surf); + MakeTwistedCubeTrimmingLoop(brep, + face, + v0, v1, v2, v3, + e0, eo0, + e1, eo1, + e2, eo2, + e3, eo3); + // should the normal be reversed? + face.m_bRev = (orientation == -1); +} + +void +MakeTwistedCubeFaces1(ON_Brep& brep) +{ + MakeTwistedCubeFace(brep, + ABCD, // index of surface geometry + +1, // orientation of surface w.r.t. brep + A, B, C, D, // indices of vertices listed in order + AB, +1, // south edge, orientation w.r.t. trimming curve? + BC, +1, // east edge, orientation w.r.t. trimming curve? + CD, +1, + AD, -1); +} + +void +MakeTwistedCubeFaces2(ON_Brep& brep) +{ + MakeTwistedCubeFace(brep, + FEHG, // index of surface geometry + +1, // orientation of surface w.r.t. brep + F, E, H, G, // indices of vertices listed in order + EF, -1, // south edge, orientation w.r.t. trimming curve? + EH, +1, // east edge, orientation w.r.t. trimming curve? + GH, -1, + FG, -1); +} + +ON_Brep* +MakeTwistedSquare1(ON_TextLog& error_log) +{ + ON_3dPoint point[8] = { + ON_3dPoint(1.0, 1.0, 1.0), // Point A + ON_3dPoint(-1.0, -1.0, 1.0), // Point B + ON_3dPoint(-1.0, -1.0, -1.0), // Point C + ON_3dPoint(1.0, 1.0, -1.0), // Point D + }; + + ON_Brep* brep = new ON_Brep(); + + // create eight vertices located at the eight points + for (int i = 0; i < 4; i++) { + ON_BrepVertex& v = brep->NewVertex(point[i]); + v.m_tolerance = 0.0; + // this example uses exact tolerance... reference + // ON_BrepVertex for definition of non-exact data + } + + // create 3d curve geometry - the orientations are arbitrarily + // chosen so that the end vertices are in alphabetical order + brep->m_C3.Append(TwistedCubeEdgeCurve(point[A], point[B])); // AB + brep->m_C3.Append(TwistedCubeEdgeCurve(point[B], point[C])); // BC + brep->m_C3.Append(TwistedCubeEdgeCurve(point[C], point[D])); // CD + brep->m_C3.Append(TwistedCubeEdgeCurve(point[A], point[D])); // AD + + // create the 12 edges the connect the corners + MakeTwistedCubeEdges1(*brep); + + // create the 3d surface geometry. the orientations are arbitrary so + // some normals point into the cube and other point out... not sure why + brep->m_S.Append(TwistedCubeSideSurface(point[A], point[B], point[C], point[D])); + + // create the faces + MakeTwistedCubeFaces1(*brep); + + if (!brep->IsValid()) { + error_log.Print("Twisted cube b-rep is not valid!\n"); + delete brep; + brep = NULL; + } + + return brep; +} + +ON_Brep* +MakeTwistedSquare2(ON_TextLog& error_log) +{ + ON_3dPoint point[8] = { + ON_3dPoint(1.0, -1.0, 1.0), // Point E + ON_3dPoint(-1.0, 1.0, 1.0), // Point F + ON_3dPoint(-1.0, -1.0, 1.0), // Point G + ON_3dPoint(1.0, -1.0, -1.0), // Point H + }; + + ON_Brep* brep = new ON_Brep(); + + // create eight vertices located at the eight points + for (int i = 0; i < 4; i++) { + ON_BrepVertex& v = brep->NewVertex(point[i]); + v.m_tolerance = 0.0; + // this example uses exact tolerance... reference + // ON_BrepVertex for definition of non-exact data + } + + // create 3d curve geometry - the orientations are arbitrarily + // chosen so that the end vertices are in alphabetical order + brep->m_C3.Append(TwistedCubeEdgeCurve(point[E], point[F])); // EF + brep->m_C3.Append(TwistedCubeEdgeCurve(point[F], point[G])); // FG + brep->m_C3.Append(TwistedCubeEdgeCurve(point[G], point[H])); // GH + brep->m_C3.Append(TwistedCubeEdgeCurve(point[E], point[H])); // EH + + // create the 12 edges the connect the corners + MakeTwistedCubeEdges2(*brep); + + // create the 3d surface geometry. the orientations are arbitrary so + // some normals point into the cube and other point out... not sure why + brep->m_S.Append(TwistedCubeSideSurface(point[E], point[F], point[G], point[H])); + + // create the faces + MakeTwistedCubeFaces2(*brep); + + if (!brep->IsValid()) { + error_log.Print("Twisted cube b-rep is not valid!\n"); + delete brep; + brep = NULL; + } + + return brep; +} + +void +printPoints(struct rt_brep_internal* bi) +{ + ON_TextLog tl(stdout); + ON_Brep* brep = bi->brep; + if (brep) { + const int count = brep->m_V.Count(); + for (int i = 0; i < count; i++) { + ON_BrepVertex& bv = brep->m_V[i]; + bv.Dump(tl); + } + } else { + bu_log("brep was NULL!\n"); + } +} + +} + int main() { - ON_Surface *surf1 = Surface(ON_3dPoint(1.0, 1.0, 1.0), ON_3dPoint(-1.0, 1.0, 1.0), ON_3dPoint(-1.0, -1.0, -1.0), ON_3dPoint(1.0, -1.0, -1.0)); - ON_Surface *surf2 = Surface(ON_3dPoint(1.0, -1.0, 1.0), ON_3dPoint(-1.0, -1.0, 1.0), ON_3dPoint(-1.0, 1.0, -1.0), ON_3dPoint(1.0, 1.0, -1.0)); + ON_3dPoint points1[4] = {ON_3dPoint(1.0, 1.0, 1.0), ON_3dPoint(-1.0, 1.0, 1.0), ON_3dPoint(-1.0, -1.0, -1.0), ON_3dPoint(1.0, -1.0, -1.0)}; + ON_3dPoint points2[4] = {ON_3dPoint(1.0, -1.0, 1.0), ON_3dPoint(-1.0, -1.0, 1.0), ON_3dPoint(-1.0, 1.0, -1.0), ON_3dPoint(1.0, 1.0, -1.0)}; + ON_TextLog log1, log2; + ON_Brep *brep1 = MakeTwistedSquare1(log1); + ON_Brep *brep2 = MakeTwistedSquare2(log2); + ON_ClassArray<ON_Curve *> out1, out2; + /* SurfaceSurfaceIntersect(surf1, surf2, 1e-4, 1e-10, out1, out2); */ return 0; } Modified: brlcad/trunk/src/proc-db/surfaceintersect.h =================================================================== --- brlcad/trunk/src/proc-db/surfaceintersect.h 2009-08-13 18:55:42 UTC (rev 35532) +++ brlcad/trunk/src/proc-db/surfaceintersect.h 2009-08-13 19:50:55 UTC (rev 35533) @@ -31,6 +31,52 @@ #include "../../include/vmath.h" #include "../src/other/openNURBS/opennurbs_array.h" +/** + * Canonical_start, Canonical_end + * + * @brief conanical domain for ON_Curves + */ +#define Canonical_start (0.0) +#define Canonical_end (1.0) + +/** + * class Curve_X_Profile(ON_Curve) + * + * @Serves to record a curve along with the intersection events of the curve and its twin + * a face it will eventually be added to. + */ +class Curve_X_Profile : public ON_Curve { + public: + ON_ClassArray<ON_X_EVENT> x; + int Compare_start(const Curve_X_Profile*, const Curve_X_Profile*); + int Compare_end(const Curve_X_Profile*, const Curve_X_Profile*); + int Render_Curves(ON_ClassArray<ON_Curve>&); +}; + +/** + * class Face_X_Event + * + * @brief analogous to ON_X_EVENT but between ON_BrepFaces + */ +class Face_X_Event{ + public: + ON_BrepFace *face1; + ON_BrepFace *face2; + ON_Curve *curve1; + ON_Curve *curve2; + ON_ClassArray<ON_Curve*> new_curves1; + ON_ClassArray<ON_Curve*> new_curves2; + ON_ClassArray<bool> loop_flags1; + ON_ClassArray<bool> loop_flags2; + ON_ClassArray<ON_X_EVENT> x; + Face_X_Event(); + Face_X_Event(ON_BrepFace*, ON_BrepFace*); + Face_X_Event(ON_BrepFace*, ON_BrepFace*, ON_Curve*, ON_Curve*); + int Get_ON_X_Events(double); + int Render_Curves(); +}; + + /** @} */ /* * Local Variables: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <n_reed@us...> - 2009-08-13 18:55:59
|
Revision: 35532 http://brlcad.svn.sourceforge.net/brlcad/?rev=35532&view=rev Author: n_reed Date: 2009-08-13 18:55:42 +0000 (Thu, 13 Aug 2009) Log Message: ----------- simplified rtgl refresh code, changed calculation of grid dimensions, dynamically scaling point width Modified Paths: -------------- brlcad/trunk/include/dm-rtgl.h brlcad/trunk/src/libdm/dm-rtgl.c brlcad/trunk/src/mged/dozoom.c brlcad/trunk/src/mged/mged.c Modified: brlcad/trunk/include/dm-rtgl.h =================================================================== --- brlcad/trunk/include/dm-rtgl.h 2009-08-13 18:45:19 UTC (rev 35531) +++ brlcad/trunk/include/dm-rtgl.h 2009-08-13 18:55:42 UTC (rev 35532) @@ -41,17 +41,13 @@ #define Rtgl_MV_O(_m) offsetof(struct modifiable_rtgl_vars, _m) -#define DM_PRIV_VARS (dmp->dm_vars.priv_vars) -#define RTGL_GEDP ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.gedp -#define RTGL_LASTJOBS ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.lastJobs -#define RTGL_JOBSDONE ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.jobsDone -#define RTGL_DOJOBS ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.doJobs +#define RTGL_MVARS (((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars) +#define RTGL_GEDP RTGL_MVARS.gedp +#define RTGL_DIRTY RTGL_MVARS.needRefresh struct modifiable_rtgl_vars { struct ged *gedp; /* used to set up ray tracing */ - time_t lastJobs; - int jobsDone; - int doJobs; + int needRefresh; int cueing_on; int zclipping_on; int zbuffer_on; @@ -93,8 +89,8 @@ struct ptInfoList { struct bu_list l; int used; - fastf_t points[PT_ARRAY_SIZE]; - fastf_t norms[PT_ARRAY_SIZE]; + float points[PT_ARRAY_SIZE]; + float norms[PT_ARRAY_SIZE]; float color[3]; }; Modified: brlcad/trunk/src/libdm/dm-rtgl.c =================================================================== --- brlcad/trunk/src/libdm/dm-rtgl.c 2009-08-13 18:45:19 UTC (rev 35531) +++ brlcad/trunk/src/libdm/dm-rtgl.c 2009-08-13 18:55:42 UTC (rev 35532) @@ -179,9 +179,8 @@ extern float backColor[]; int controlClip = 1; +int calls, jobsDone; -int calls; - /* ray trace vars */ struct application app; struct rt_i *rtip; @@ -294,6 +293,7 @@ bu_vls_strcpy(&init_proc_vls, "bind_dm"); calls = 1; + jobsDone = 1; /* initialize dm specific variables */ ((struct dm_xvars *)dmp->dm_vars.pub_vars)->devmotionnotify = LASTEvent; @@ -302,20 +302,18 @@ dmp->dm_aspect = 1.0; /* initialize modifiable variables */ - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.gedp = GED_NULL; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.lastJobs = 0; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.jobsDone = 1; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.doJobs = 0; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.rgb = 1; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.doublebuffer = 1; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.fastfog = 1; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.fogdensity = 1.0; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.lighting_on = dmp->dm_light; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.zbuffer_on = dmp->dm_zbuffer; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.debug = dmp->dm_debugLevel; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.bound = dmp->dm_bound; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.boundFlag = dmp->dm_boundFlag; - ((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars.zclipping_on = dmp->dm_zclip; + RTGL_MVARS.gedp = GED_NULL; + RTGL_MVARS.needRefresh = 0; + RTGL_MVARS.rgb = 1; + RTGL_MVARS.doublebuffer = 1; + RTGL_MVARS.fastfog = 1; + RTGL_MVARS.fogdensity = 1.0; + RTGL_MVARS.lighting_on = dmp->dm_light; + RTGL_MVARS.zbuffer_on = dmp->dm_zbuffer; + RTGL_MVARS.debug = dmp->dm_debugLevel; + RTGL_MVARS.bound = dmp->dm_bound; + RTGL_MVARS.boundFlag = dmp->dm_boundFlag; + RTGL_MVARS.zclipping_on = dmp->dm_zclip; /* this is important so that rtgl_configureWin knows to set the font */ ((struct dm_xvars *)dmp->dm_vars.pub_vars)->fontstruct = NULL; @@ -1213,9 +1211,10 @@ VADD2(pt, pt, center); /* jitter point */ +#if 0 VSET(jit, jitter(halfRad), jitter(halfRad), jitter(halfRad)); VADD2(pt, pt, jit); - +#endif VMOVE(app.a_ray.r_dir, pt); @@ -1331,7 +1330,7 @@ } /* shoot an even grid of parallel rays in a principle direction */ -void shootGrid(vect_t min, vect_t max, int pixels, int viewSize, int uAxis, int vAxis, int iAxis) { +void shootGrid(vect_t min, vect_t max, double maxSpan, int pixels, int uAxis, int vAxis, int iAxis) { int i, j; vect_t span; @@ -1340,16 +1339,15 @@ /* calculate span in each dimension */ VSUB2(span, max, min); - /* calculate firing intervals */ - int uDivs = pixels * (span[uAxis] / viewSize); - int vDivs = pixels * (span[vAxis] / viewSize); + /* calculate firing intervals (trying to achieve pixel density) */ + int uDivs = pixels * (span[uAxis] / maxSpan); + int vDivs = pixels * (span[vAxis] / maxSpan); -#if 0 + bu_log("adding %d x %d jobs", uDivs, vDivs); + +#if 1 uDivs /= 2; vDivs /= 2; -#else - uDivs *= 1.5; - vDivs *= 1.5; #endif fastf_t uWidth = span[uAxis] / uDivs; @@ -1424,8 +1422,8 @@ return 1; } -void drawPoints(fastf_t *view) { - glPointSize(1); +void drawPoints(fastf_t *view, int pointSize) { + glPointSize(pointSize); #if 0 /* use vertex arrays */ glEnableClientState(GL_VERTEX_ARRAY); @@ -1635,8 +1633,9 @@ } -vect_t min, max, span, center, view, vect; +vect_t min, max, center, view, vect; fastf_t radius; +double maxSpan; /* * R T G L _ D R A W V L I S T @@ -1646,6 +1645,7 @@ rtgl_drawVList(struct dm *dmp, register struct bn_vlist *vp) { int i, j, new, numVisible, numNew, maxPixels, viewSize; + vect_t span; char *currTree, *visibleTrees[RT_MAXARGS]; struct ptInfoList *curr; @@ -1707,14 +1707,15 @@ oldNumTrees = 0; freeInfoList(); - RTGL_JOBSDONE = 1; - RTGL_DOJOBS = 0; + RTGL_DIRTY = 0; /* reset for dynamic z-clipping */ - if (dmp->dm_zbuffer) { + if (dmp->dm_zclip) { startScale = 1; } + maxSpan = 0.0; + return TCL_OK; } @@ -1764,43 +1765,67 @@ VMOVE(max, rtip->mdl_max); VSUB2(span, max, min); - /* get parameters of bounding sphere */ - radius = 100 + sqrt((span[X] * span[X]) + (span[Y] * span[Y]) + (span[Z] * span[Z])); + maxSpan = span[X]; - center[X] = (min[X] + max[X]) / 2; - center[Y] = (min[Y] + max[Y]) / 2; - center[Z] = (min[Z] + max[Z]) / 2; + if (span[Y] > maxSpan) + maxSpan = span[Y]; + if (span[Z] > maxSpan) + maxSpan = span[Z]; + #if 1 /* shoot grid of rays in each principle direction */ - shootGrid(min, max, maxPixels, viewSize, X, Y, Z); - shootGrid(min, max, maxPixels, viewSize, Z, X, Y); - shootGrid(min, max, maxPixels, viewSize, Y, Z, X); + shootGrid(min, max, maxSpan, maxPixels, X, Y, Z); + shootGrid(min, max, maxSpan, maxPixels, Z, X, Y); + shootGrid(min, max, maxSpan, maxPixels, Y, Z, X); #else + /* use length of bounding box's longest diagonal as radius of bounding sphere */ + radius = sqrt((span[X] * span[X]) + (span[Y] * span[Y]) + (span[Z] * span[Z])); + /* use center of bounding box as center of bounding sphere */ + center[X] = (min[X] + max[X]) / 2; + center[Y] = (min[Y] + max[Y]) / 2; + center[Z] = (min[Z] + max[Z]) / 2; + randShots(center, radius, 1); #endif /* new jobs to do */ - RTGL_DOJOBS = 1; + jobsDone = 0; } /* numNew > 0 */ + /* get view vector */ vect_t vCenter; VSET(vCenter, 0, 0, 0); aeVect(view, gedp->ged_gvp->gv_aet, vCenter, 1); - drawPoints(view); + /* determine point size */ + int pointSize = 4; - calls++; + if (maxSpan != 0.0) { + double ratio = maxSpan / viewSize; + + pointSize = 4 * ratio; + + if (pointSize < 1) + pointSize = 1; + } + + drawPoints(view, pointSize); - if (RTGL_DOJOBS) { - RTGL_JOBSDONE = shootJobs(); - if (RTGL_JOBSDONE) { - RTGL_DOJOBS = 0; + if (!jobsDone) { + RTGL_DIRTY = 1; + + if ((jobsDone = shootJobs())) { + bu_log("jobs done"); } + } else { + RTGL_DIRTY = 0; } + calls++; + return TCL_OK; } Modified: brlcad/trunk/src/mged/dozoom.c =================================================================== --- brlcad/trunk/src/mged/dozoom.c 2009-08-13 18:45:19 UTC (rev 35531) +++ brlcad/trunk/src/mged/dozoom.c 2009-08-13 18:55:42 UTC (rev 35532) @@ -405,12 +405,12 @@ /* dm-rtgl needs database info for ray tracing */ RTGL_GEDP = gedp; - /* draw, and possibly do ray tracing */ + /* will ray trace visible objects and draw the intersection points */ DM_DRAW_VLIST(dmp, (struct bn_vlist *)NULL); + + /* force update if needed */ + dirty = RTGL_DIRTY; - /* still more updates needed */ - dirty = 1; - return; } #endif Modified: brlcad/trunk/src/mged/mged.c =================================================================== --- brlcad/trunk/src/mged/mged.c 2009-08-13 18:45:19 UTC (rev 35531) +++ brlcad/trunk/src/mged/mged.c 2009-08-13 18:55:42 UTC (rev 35532) @@ -81,10 +81,6 @@ #include "./cmd.h" #include "brlcad_version.h" -#ifdef DM_RTGL -# include "dm-rtgl.h" -#endif - #ifndef COMMAND_LINE_EDITING # define COMMAND_LINE_EDITING 1 #endif @@ -272,17 +268,6 @@ void _set_invalid_parameter_handler(void *callback) { return; } #endif - -void idle_update(ClientData data) -{ -#ifdef DM_RTGL - if (!RTGL_JOBSDONE) { - RTGL_DOJOBS = 1; - } -#endif -} - - /* * M A I N */ @@ -879,8 +864,6 @@ /* This test stops optimizers from complaining about an infinite loop */ if ( (rateflag = event_check( rateflag )) < 0 ) break; - Tcl_DoWhenIdle(idle_update, NULL); - /* * Cause the control portion of the displaylist to be * updated to reflect the changes made above. @@ -1666,8 +1649,8 @@ handled++; } } else { - /* Wait for a non-idle event, then handle it */ - Tcl_DoOneEvent(TCL_ALL_EVENTS & (!TCL_IDLE_EVENTS)); + /* Wait for an event, then handle it */ + Tcl_DoOneEvent(TCL_ALL_EVENTS); /* Handle any other events in the queue */ while (Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <n_reed@us...> - 2009-08-13 18:45:31
|
Revision: 35531 http://brlcad.svn.sourceforge.net/brlcad/?rev=35531&view=rev Author: n_reed Date: 2009-08-13 18:45:19 +0000 (Thu, 13 Aug 2009) Log Message: ----------- fixed typo causing compile error Modified Paths: -------------- brlcad/trunk/src/librt/primitives/brep/brep.cpp Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp =================================================================== --- brlcad/trunk/src/librt/primitives/brep/brep.cpp 2009-08-13 15:27:54 UTC (rev 35530) +++ brlcad/trunk/src/librt/primitives/brep/brep.cpp 2009-08-13 18:45:19 UTC (rev 35531) @@ -2591,8 +2591,8 @@ int nfaces; RT_CK_DB_INTERNAL(ip); - tip = (struct rt_brep_internal *)ip->idb_ptr; - RT_BREP_CK_MAGIC(tip); + bi = (struct rt_brep_internal *)ip->idb_ptr; + RT_BREP_CK_MAGIC(bi); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <starseeker@us...> - 2009-08-13 15:28:03
|
Revision: 35530 http://brlcad.svn.sourceforge.net/brlcad/?rev=35530&view=rev Author: starseeker Date: 2009-08-13 15:27:54 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Start adding a little of the boilerplate for brep tesselation. Modified Paths: -------------- brlcad/trunk/src/librt/primitives/brep/brep.cpp Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp =================================================================== --- brlcad/trunk/src/librt/primitives/brep/brep.cpp 2009-08-12 21:40:27 UTC (rev 35529) +++ brlcad/trunk/src/librt/primitives/brep/brep.cpp 2009-08-13 15:27:54 UTC (rev 35530) @@ -2581,6 +2581,19 @@ rt_brep_tess(struct nmgregion **r, struct model *m, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol) { return -1; + struct rt_brep_internal *bi; + + struct shell *s; + struct vertex **verts; + struct faceuse **faces; + fastf_t *norms; + struct vertex **vertp[4]; + int nfaces; + + RT_CK_DB_INTERNAL(ip); + tip = (struct rt_brep_internal *)ip->idb_ptr; + RT_BREP_CK_MAGIC(tip); + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |