~ubuntu-branches/debian/jessie/3dldf-doc/jessie

« back to all changes in this revision

Viewing changes to doc/old_doc/line.texi

  • Committer: Package Import Robot
  • Author(s): Jerome Benoit
  • Date: 2014-06-05 12:52:40 UTC
  • Revision ID: package-import@ubuntu.com-20140605125240-h52ban7gnlko50qe
Tags: upstream-2.0.3+ndfsg
ImportĀ upstreamĀ versionĀ 2.0.3+ndfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@c line.texi
 
2
     
 
3
@c This file is part of the 3DLDF User and Reference Manual.
 
4
@c Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The Free Software Foundation 
 
5
@c See the section "GNU Free Documentation License" in the file 
 
6
@c fdl.texi for copying conditions.
 
7
 
 
8
    
 
9
@node Line Reference, Plane Reference, Focus Reference, Top
 
10
@chapter Line Reference
 
11
 
 
12
@tindex Line
 
13
The @code{struct Line} is defined in @file{lines.web}.
 
14
@code{Lines} are not @code{Shapes}.  They are used for
 
15
performing vector operations.  A @code{Line} is defined by a
 
16
@code{Point} representing a position vector and a @code{Point}
 
17
representing a direction vector.
 
18
 
 
19
See also the descriptions of @code{Point::get_line()} in 
 
20
@ref{Points and Lines}, and 
 
21
@code{Path::get_line()} in 
 
22
@ref{Querying Paths,,Path Reference; Querying}.
 
23
 
 
24
 
 
25
@menu
 
26
* Line Data Members::           
 
27
* Line Global Constants::       
 
28
* Line Constructors::           
 
29
* Line Operators::              
 
30
* Get Path::                    
 
31
* Showing::                     
 
32
@end menu
 
33
 
 
34
@node Line Data Members, Line Global Constants, Line Reference, Line Reference
 
35
@section Data Members
 
36
 
 
37
@deftypevr {Public variable} Point position
 
38
Represents the position vector of the @code{Line}.
 
39
@end deftypevr 
 
40
 
 
41
@deftypevr {Public variable} Point direction
 
42
Represents the direction vector of the @code{Line}.
 
43
@end deftypevr 
 
44
 
 
45
@node Line Global Constants, Line Constructors, Line Data Members, Line Reference
 
46
@section Global Constants
 
47
@deftypevr {Constant} {const Line} INVALID_LINE
 
48
@code{position} and @code{direction} are both @code{INVALID_POINT}.
 
49
@end deftypevr 
 
50
 
 
51
@node Line Constructors, Line Operators, Line Global Constants, Line Reference
 
52
@section Constructors
 
53
 
 
54
@deftypefn {Default constructor} void Line ({const Point&} @var{pos} = @code{origin}, {const Point&} @var{dir} = @code{origin})
 
55
Creates a @code{Line}, setting @code{position} to @var{pos}, and
 
56
@code{direction} to @var{dir}.  If this function is called with no
 
57
arguments, it creates a @code{Line} at the @code{origin} with no
 
58
direction.  
 
59
 
 
60
@example
 
61
Point p(2, 1, 2);
 
62
Point d(-3, 3, 3.5);
 
63
Line L0(p, d);
 
64
Line L1 = p.get_line(d);
 
65
@end example
 
66
 
 
67
@iftex
 
68
@tex
 
69
\ifmakeexamples
 
70
\BEX
 
71
\BGRP
 
72
\immediate\write\examples{default_focus.set(2, 3, -10, 0, 3, 10, 10);}
 
73
\immediate\write\examples{draw_axes(gray);}
 
74
\immediate\write\examples{stringstream s;}
 
75
\immediate\write\examples{Point p(2, 1, 2);}
 
76
\immediate\write\examples{Point d(-3, 3, 3.5);}
 
77
\immediate\write\examples{p.dotlabel("$p$"); }
 
78
\immediate\write\examples{p.label(Point::WORLD_VALUES, "bot");}
 
79
\immediate\write\examples{p.draw(d, black, "evenly");}
 
80
\immediate\write\examples{Line L0(p, d);}
 
81
\immediate\write\examples{s << "$d @DBKS{equiv} L_0.@OCB@DBKS{tt} direction@CCB @DBKS{equiv} (" }
 
82
\immediate\write\examples{  << L0.direction.get_x()}
 
83
\immediate\write\examples{  << ", " << L0.direction.get_y() << ", " << L0.direction.get_z()}
 
84
\immediate\write\examples{  << ")$";}
 
85
\immediate\write\examples{L0.direction.label(s.str()); }
 
86
\immediate\write\examples{origin.drawarrow(L0.direction);}
 
87
\immediate\write\examples{Line L1 = p.get_line(d);}
 
88
\immediate\write\examples{s.str("");}
 
89
\immediate\write\examples{s << "$L_1.@OCB@DBKS{tt} direction@CCB @DBKS{equiv} (" << L1.direction.get_x()}
 
90
\immediate\write\examples{  << ", " << L1.direction.get_y() << ", " << L1.direction.get_z()}
 
91
\immediate\write\examples{  << ")$";}
 
92
\immediate\write\examples{L1.direction.label(s.str());}
 
93
\immediate\write\examples{origin.drawarrow(L1.direction); }
 
94
\OEX{}
 
95
\EGRP
 
96
\EEX 1
 
97
\fi
 
98
\PEX
 
99
@end tex
 
100
@end iftex
 
101
 
 
102
@ifhtml
 
103
@html
 
104
<p align="center">
 
105
<br>
 
106
<img src="./graphics/png/3DLDF104.png"
 
107
alt="[Figure 104. Not displayed.]"
 
108
/>
 
109
<br>
 
110
<br>
 
111
Fig. 104.
 
112
<br>
 
113
</p>
 
114
@end html
 
115
@end ifhtml
 
116
 
 
117
@ifinfo
 
118
[Figure 104 not displayed.]
 
119
@end ifinfo
 
120
 
 
121
@end deftypefn
 
122
 
 
123
@deftypefn {Copy constructor} void Line ({const Line&} @var{l})
 
124
Creates a @code{Line}, making it a copy of @var{l}.
 
125
@end deftypefn 
 
126
 
 
127
 
 
128
@node Line Operators, Get Path, Line Constructors, Line Reference
 
129
@section Operators
 
130
 
 
131
@deftypefn {Assignment operator} void operator= ({const Line&} @var{l})
 
132
Sets @code{*this} to @var{l}.
 
133
@end deftypefn 
 
134
 
 
135
@c LDF 2003.06.03.  Add description of @code{get_distance()}, when I've
 
136
@c fixed it. 
 
137
 
 
138
@node Get Path, Showing, Line Operators, Line Reference
 
139
@section Get Path
 
140
 
 
141
@deftypefn {@code{const} function} Path get_path (void)
 
142
Returns a linear @code{Path} with two @code{Points}
 
143
on the @code{Line}.  The first @code{Point} will be @code{position}, and
 
144
the second will be @code{position + direction}.
 
145
@end deftypefn 
 
146
 
 
147
@node Showing,  , Get Path, Line Reference
 
148
@section Showing
 
149
 
 
150
@deftypefun void show ([string @var{text} = ""])
 
151
If @var{text} is not the empty @code{string} (the default), it is
 
152
printed on a line of its own to standard output.  Otherwise, @samp{Line:}
 
153
is printed.  Following this, @code{Point::show()} is called on
 
154
@code{position} and @code{direction}.
 
155
 
 
156
@example
 
157
Point p(1, -2, 3);
 
158
Point d(-12.3, 21, 36.002);
 
159
Line L0(p, d);
 
160
L0.show("L0:");
 
161
@print{} L0:
 
162
   position: (1, -2, 3)
 
163
   direction: (-12.3, 21, 36.002)
 
164
Line L1 = p.get_line(d);
 
165
L1.show("L1:");
 
166
@print{} L1:
 
167
   position: (1, -2, 3)
 
168
   direction: (-13.3, 23, 33.002)
 
169
Path q = L1.get_path();
 
170
q.show("q:");
 
171
@print{} q:
 
172
   fill_draw_value == 0
 
173
   (1, -2, 3) -- (-12.3, 21, 36.002);
 
174
@end example
 
175
@end deftypefun 
 
176