BRL-CAD
ssx_event.cpp
Go to the documentation of this file.
1 /* S S X _ E V E N T . C P P
2  * BRL-CAD
3  *
4  * Copyright (c) 2013-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file ssx_event.cpp
21  *
22  * Extend the ssx_event routines provided by openNURBS.
23  *
24  */
25 
26 #include "common.h"
27 #include "brep.h"
28 
29 void
30 DumpSSXEvent(ON_SSX_EVENT &x, ON_TextLog &text_log)
31 {
32  text_log.Print("m_type: ");
33  switch (x.m_type) {
34  case ON_SSX_EVENT::no_ssx_event:
35  text_log.Print("no_ssx_event");
36  break;
37  case ON_SSX_EVENT::ssx_transverse:
38  text_log.Print("ssx_transverse");
39  break;
40  case ON_SSX_EVENT::ssx_tangent:
41  text_log.Print("ssx_tangent");
42  break;
43  case ON_SSX_EVENT::ssx_overlap:
44  text_log.Print("ssx_overlap");
45  break;
46  case ON_SSX_EVENT::ssx_transverse_point:
47  text_log.Print("ssx_transverse_point");
48  break;
49  case ON_SSX_EVENT::ssx_tangent_point:
50  text_log.Print("ssx_tangent_point");
51  break;
52  default:
53  text_log.Print("illegal value");
54  break;
55  }
56  text_log.Print("\n");
57  text_log.PushIndent();
58 
59  switch (x.m_type) {
60  case ON_SSX_EVENT::ssx_transverse_point:
61  case ON_SSX_EVENT::ssx_tangent_point:
62  // don't use %g so the text_log double format can control display precision
63  text_log.Print("SurfaceA(");
64  text_log.Print(x.m_pointA[0]);
65  text_log.Print(",");
66  text_log.Print(x.m_pointA[1]);
67  text_log.Print(") = \n");
68 
69  text_log.Print("SurfaceB(");
70  text_log.Print(x.m_pointB[0]);
71  text_log.Print(",");
72  text_log.Print(x.m_pointB[1]);
73  text_log.Print(") = \n");
74 
75  text_log.PushIndent();
76  text_log.Print(x.m_point3d);
77  text_log.Print("\n");
78  text_log.PopIndent();
79  break;
80 
81  case ON_SSX_EVENT::ssx_transverse:
82  case ON_SSX_EVENT::ssx_tangent:
83  case ON_SSX_EVENT::ssx_overlap:
84  text_log.Print("SurfaceA:\n");
85  text_log.PushIndent();
86  x.m_curveA->Dump(text_log);
87  text_log.PopIndent();
88 
89  text_log.Print("SurfaceB:\n");
90  text_log.PushIndent();
91  x.m_curveB->Dump(text_log);
92  text_log.PopIndent();
93 
94  text_log.Print("3D curves:\n");
95  text_log.PushIndent();
96  x.m_curve3d->Dump(text_log);
97  text_log.PopIndent();
98  break;
99 
100  case ON_SSX_EVENT::no_ssx_event:
101  case ON_SSX_EVENT::ssx_32bit_enum:
102  // these extra cses keep gcc happy and quiet
103  break;
104  }
105 }
106 
107 // Local Variables:
108 // tab-width: 8
109 // mode: C++
110 // c-basic-offset: 4
111 // indent-tabs-mode: t
112 // c-file-style: "stroustrup"
113 // End:
114 // ex: shiftwidth=4 tabstop=8
Header file for the BRL-CAD common definitions.
void DumpSSXEvent(ON_SSX_EVENT &x, ON_TextLog &text_log)
Definition: ssx_event.cpp:30