A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/gltube_8hpp_source.html below:

NCBI C++ ToolKit: include/gui/opengl/gltube.hpp Source File

1 #ifndef GUI_OPENGL___GLTUBE__HPP 2 #define GUI_OPENGL___GLTUBE__HPP 51 template

<

class

Curve>

72  void Draw

(

float error

,

size_t

min_segs,

123  float

u_hi,

const TPoint

& pos_hi,

124  float error

)

const

;

128  size_t

spokes,

float

radius,

TRing

& ring)

const

;

132 template

<

class

Curve>

142 template

<

class

Curve>

150 template

<

class

Curve>

158 template

<

class

Curve>

167 template

<

class

Curve>

175 template

<

class

Curve>

183 template

<

class

Curve>

187

Draw(GetError(), 2,

mode

);

191 template

<

class

Curve>

195  float

u_step = 1.0f / min_segs;

197  TPoint

pos0 = EvalPos(0.0f);

199  static const

GLenum modes[] ={

205

glPolygonMode(GL_FRONT_AND_BACK, modes[

mode

]);

208  TPoint

norm(0.0f, 1.0f, 0.0f);

209  TPoint

axis = EvalPos(0.01f) - EvalPos(0.0f);

211  if

(norm.

Dot

(axis) < 0.0001f) {

212

norm =

TPoint

(0.0f, 0.0f, 1.0f);

215

norm = axis.

Cross

(norm);

218

x_GetRing(0, norm, m_Spokes, m_Start, ring);

220  for

(u = 0; u < 1.0f; u += u_step) {

221  TPoint

pos1 = EvalPos(u + u_step);

222

x_DrawRecursive(u, pos0, norm, ring, u+u_step, pos1,

error

);

234 template

<

class

Curve>

238  float

u_hi,

const TPoint

& pos_hi,

241

u_hi =

min

(u_hi, 1.0f);

244  float

u_mid = (u_lo + u_hi) * 0.5f;

245  TPoint

pos_mid = EvalPos(u_mid);

248  float

len0 = (pos_lo - pos_hi).Length();

249  float

len1 = (pos_mid - pos_lo).Length() + (pos_hi - pos_mid).Length();

251  TPoint

axis_hi_mid(pos_hi - pos_mid);

253

norm_hi = norm_hi.

Cross

(axis_hi_mid);

255  TPoint

norm_mid(norm_hi + norm_lo);

259  if

((len1 - len0) / len0 >

error

) {

261 

x_DrawRecursive(u_lo, pos_lo, norm_lo, ring, u_mid, pos_mid,

error

);

262

x_DrawRecursive(u_mid, pos_mid, norm_mid, ring, u_hi, pos_hi,

error

);

267

x_GetRing(u_hi, norm_hi, m_Spokes,

268

m_Start + u_hi * (m_End - m_Start),

282

glBegin(GL_QUAD_STRIP);

284  typename

TRing::const_iterator this_iter = ring.begin();

285  typename

TRing::const_iterator next_iter =

next

.begin();

286  for

( ; this_iter != ring.end(); ++this_iter, ++next_iter) {

287

glNormal3fv(this_iter->norm.GetData());

288

glVertex3fv(this_iter->pos.GetData());

290

glNormal3fv(next_iter->norm.GetData());

291

glVertex3fv(next_iter->pos.GetData());

303 template

<

class

Curve>

306  size_t

spokes,

float

radius,

309  float

u1 = u + 0.005f;

314  TPoint

start = EvalPos(u);

316  TPoint

axis = start - end;

324

ring.reserve(spokes + 1);

325  for

(

size_t i

=0;

i

< spokes; ++

i

) {

327

rp.

pos

= start + nv;

334

ring.push_back(ring.front());

338 template

<

class

Curve>

346 template

<

class

Curve>

350  return

m_Curve.GetError();

354 template

<

class

Curve>

358

m_Curve.SetError(

f

);

362 template

<

class

Curve>

366  return

m_Curve.GetPoint(

i

);

370 template

<

class

Curve>

374  return

m_Curve.SetPoint(

i

);

378 template

<

class

Curve>

382

m_Curve.SetPoint(

i

, point);

386 template

<

class

Curve>

390  return

m_Curve.EvalPos(u);

394 template

<

class

Curve>

398  return

m_Curve.EvalTan(u);

402 template

<

class

Curve>

406  return

m_Curve.EvalCurve(u);

class ICurve defines a basic interface for all curves.

Include a standard set of the NCBI C++ Toolkit most basic headers.

static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)

CVect3< T > Cross(const CVect3< T > &) const

T Dot(const CVect3< T > &) const

void Rotate(CVect3< float > &point) const

float GetStartRadius(void) const

non-curve specifics

void SetStartRadius(float f)

void Draw(ERenderMode mode=eRender_Default) const

draw!

size_t GetNumSpokes(void) const

void x_DrawRecursive(float u_lo, const TPoint &pos_lo, TPoint &norm_lo, TRing &ring_lo, float u_hi, const TPoint &pos_hi, float error) const

internal (recursive) draw function this implements a subdivision with an error level

float GetEndRadius(void) const

TPoint EvalPos(float u) const

void SetEndRadius(float f)

TPoint EvalTan(float u) const

void SetNumSpokes(size_t spokes)

float GetError() const

access the level of detail

TPoint & SetPoint(size_t i)

void Recalc()

recalculate the curve (curve-specific)

const TPoint & GetPoint(size_t i) const

access control points of the curve

void x_GetRing(float u, const TPoint &normal, size_t spokes, float radius, TRing &ring) const

TPoint EvalCurve(float u) const

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4