C++ Practical courses Who are we? Cerquaglia Marco (B52/3, +2/540) - - PowerPoint PPT Presentation

c practical courses
SMART_READER_LITE
LIVE PREVIEW

C++ Practical courses Who are we? Cerquaglia Marco (B52/3, +2/540) - - PowerPoint PPT Presentation

C++ Practical courses Who are we? Cerquaglia Marco (B52/3, +2/540) MarcoLucio.Cerquaglia@uliege.be Teaching assistants at the A&M department. Leblanc Christophe (B52/3, +2/442) Christophe.Leblanc@uliege.be Teaching


slide-1
SLIDE 1

C++ Practical courses

  • Who are we?

– Cerquaglia Marco (B52/3, +2/540)

  • MarcoLucio.Cerquaglia@uliege.be
  • Teaching assistants at the A&M department.

– Leblanc Christophe (B52/3, +2/442)

  • Christophe.Leblanc@uliege.be
  • Teaching assistants at the A&M department.
  • Course web page: http://www.cgeo.ulg.ac.be/CADCG/

– Schedules, course ressources… – Please check-it regularly !

slide-2
SLIDE 2

Structure of a C++ project

  • Declarations

Header file (*.h)

  • Implementations
  • (« true » code)

Source file (*.cc)

source code

slide-3
SLIDE 3

Structure of a C++ project

Gnurbs lib. VTK lib. CMake Project file Executable

Compilation Generation

slide-4
SLIDE 4

Somme references

Book: "A Tour of C++", Bjarne Stroustrup

  • Ed. Addison-Wesley (2013)

ISBN 978-0-321-958310 Website: https://en.cppreference.com (An extensive reference of existing standard functions with examples).

slide-5
SLIDE 5

i j j

slide-6
SLIDE 6

Class nlagrange

Non-reachable from outside the class Reachable from outside the class.

slide-7
SLIDE 7

Class nlagrange

Parametric values of the control points

slide-8
SLIDE 8

Class nlagrange

Positions of the control points Parametric values of the control points

slide-9
SLIDE 9

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points

slide-10
SLIDE 10

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor

slide-11
SLIDE 11

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only)

slide-12
SLIDE 12

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only)

slide-13
SLIDE 13

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP

slide-14
SLIDE 14

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP Get the minimum u (read-only)

slide-15
SLIDE 15

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP Get the minimum u (read-only) Get the maximum u (read-only)

slide-16
SLIDE 16

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP Get the minimum u (read-only) Get the maximum u (read-only) Get point on curve

  • f parameter u_
slide-17
SLIDE 17

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP Get the minimum u (read-only) Get the maximum u (read-only) Get point on curve

  • f parameter u_

Get CP nr. ‘which’

slide-18
SLIDE 18

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP Get the minimum u (read-only) Get the maximum u (read-only) Get point on curve

  • f parameter u_

Get CP nr. ‘which’  Set CP nr. ‘which’

slide-19
SLIDE 19

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP Get the minimum u (read-only) Get the maximum u (read-only) Get point on curve

  • f parameter u_

Get CP nr. ‘which’  Set CP nr. ‘which’  Translate curve by vector ‘vec’

slide-20
SLIDE 20

Class nlagrange

Positions of the control points Parametric values of the control points  Number of control points Constructor Get the polynomial degree (read-only) Get the number of control points (read-only) Add a CP Get the minimum u (read-only) Get the maximum u (read-only) Get point on curve

  • f parameter u_

Get CP nr. ‘which’  Set CP nr. ‘which’  Translate curve by vector ‘vec’ Get parametric value ‘which’

slide-21
SLIDE 21

Class npoint: usage

  • Constructor

– npoint p(0.0, 0.0, 0.0, 1.0); // Euclidean point (0, 0, 0)

  • Get coordinates

– double x = p[0]; // Get coordinate x – … – double w = p[1]; // Get coordinate w (always 1 for the moment)

  • Set coordinates

– p[0] = x; // Set coordinate x – … – p[3] = w; // Set coordinate w

slide-22
SLIDE 22

Class nlagrange: usage

  • Constructor

– nlagrange curve(7); // Create a lagrange curve with 7 CPs.

  • Get/Set parametric values

– double u = curve.u(i); – curve.u(i) = …;

  • Get/Set control points

– npoint cp = curve.CP(i); – npoint new_cp(…, …, …, 1); curve.set_CP(i, new_cp);