SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
hahahFinal Project
Principles of Computer Graphics 2010
Project report

Student: Umberto Di Staso – 142685
Professor: Raffaele de Amicis


7/8/2010
GENERAL SYSTEM OVERVIEW
The project consists in a software that uses a developed library in the Intermediate project to construct
complex functionalities.

The functional asked requisites are:

    1. Load a picture in background.
    2. Generate different kinds of curves using points generated by mouse.
          a. Hermite Spline,
          b. Bezier Spline,
          c. BSpline,
          d. Lagrange.

         In this way we can isolate the perimeter of the previous loaded picture.

    3. Move single points using the mouse drag property.
    4. Select multi points and move them together.
    5. Curves must be connected to each other.
    6. Save the composition of curves in a file.
    7. Load the composition of curves saved before.
    8. Load a point file ad interpolate the points using the available curves. In this way we can observe the
       differences generated when same points are interpolated by different kind curves.
    9. Change in real time the kind of curve that interpolates a set of points.

Below we can see the use case diagram that includes the functionality requisites listed before.
Class Diagram:




The application consists in a set of classes connected to a Main class. As we can see, there are two kinds of
listeners associated to the principal class:

    1. MouseListener: contains the method used to capture mouse events. Thanks to this kind of listener I
       can intercept events used to add or drag points over the screen.
    2. EventListener: core listener of program. It contains all the methods I have used to manage the
       functionalities provided by JOGL. As we can see, the developed library and some others classes are
       used in this listener.

There are also some important classes used in the software:

    1. Texture: used to generate the texture that I have put in the background of the screen.
    2. GUI: generates the Graphical User Interface of the software.
FINAL PROJECT GUI
The Graphical User Interface is completely designed by using Swing components. The reason of this choice
is simply because I needed objects like buttons, radio buttons and checkboxes to manage the
functionalities provided by the application.




As we can see in the image above, the software gives us a large set of choices used for different kinds of
operations:

    1. Picture canvas: this area is the portion of the screen that is used to visualize the image that we
       have loaded before, and set, using the mouse, the points in which the set curve will pass.
    2. Clear button: this button clears the picture canvas of any curve we have painted before.
    3. Curves set: set of curves that we own:
            a. Bezier spline,
            b. Lagrange,
            c. Hermite spline,
            d. BSpline.
    4. Delete last point: deletes the last point of the last curve.
    5. Move points: option used when we want to move the points of a specific curve (set using the
       combo box #8).
    6. Ctrl select: this option works with the move points option. It allows us to select precise points of a
       specific curve, and move it all together.
7. Change curve: this option allows us to change in real time the kind of a set curve. For example, we
    can change a Bezier spline in a Lagrange and vice versa.
8. Select curve: this combo box is used to set the curve we want to work with. It operates through
    options 5-6-7.
9. Load image: used to load any image in background.
10. Load a blank image: used to load a white background image. In this way we can observe in a better
    manner the result of our curves.
11. Restore default image: thanks to this option, we can restore the default image in background.
    Default image is simply a cup.
12. Load point file: with this option we can load a point file from our hard disk. The point file will be
    interpolated using the curves showed before.
13. Load a curve: through this option we can restore a curve painted before. When the curve is
    restored, we can add points and extend the restored curve.
14. Save curve: produces the file that will be loaded by using the option showed before.
15. Hide points: allow us to hide all points over the screen. Using this option we can see better ours
    results.
FINAL PROJECT AT WORK
In this section I want to show, using some images, how the system works.

The first image shows how we can isolate the perimeter of the default image using the tools we have.




Now we can hide all points to see better the final result.
The final step is load a blank background image for emphasize the curves.




Next image shows how a curve can be changed in any type of curve using the “change curve” option.
As we have seen, same points can be interpolated by different curves simply by checking the “change curve
option”, setting the curve number that we want to change using the combo box and, at last, selecting the
final curve. It is possible that a curve can not be changed in another curve, e.g. a BSpline with 3 control
points can not be interpolated by a Bezier, because it requires 4 control points. In this case, no changes will
be done, and the original BSpline remains the same.

The next picture shows how users can move points in three different ways.




The simplest one is the classic “drag” option. It will be enabled when “move points” is selected, and a single
point on the picture is dragged.

If I drag my mouse, starting where there are not pints, multi point selection will be enabled. This option
draws a purple rectangle exactly when I click the mouse and ends when I release the left mouse button.
The points inside this area will be moved all together.

The last option is called “ctrl selection”. It permits to drag points that are not adjacent, simply by selecting
the points that I want to move and drag one of them. When the points are enabled with ctrl selection, they
change color, which is really useful because in this way I can see where ctrl selection is enabled.
The last functionality of the system is dedicated to load a point file and interpolate the points using all the
curves that I have.

In particular, I when a point file is loaded, the curves that will be generated are:

    1. Bezier,
    2. Hermite Spline,
    3. BSpline with 2-3-4 degree.

No Lagrange curve is used and the motivation is simple: processing this kind of curve with a very high
number of points requests too many resources from the pc where the program is running.

Elements of the file points must be listed in this form:

                                                       [X, Y]

Where X and Y are the coordinates of a point. For example:

                                [0.3502722323049001,-0.7918781725888325]

Is a point inserted in to the file enclosed in the project.
As we did before, we can hide all points




It is really interesting to notice that the difference between the three kinds of curves that I have used is
minimal: the general path is the same, and there are no relevance differences.
CONCLUSIONS
During the implementation of this project I have used many materials of the library that have been
developed during the Intermediate Project. Major problematic was born when the system checked if the
number of points that composed any type of curves was correct: different types of curves need different
numbers of points. Another variable that can be found is if a curve is painted at first or not.

To better understand this kind of problematic could be useful have a look at the image below.




First curve is a classic Bezier: it requires simply four control points. The second image shows how two
curves can be consecutive: at first three points (yellow circle) belong to a Lagrange curve, that does not
require a critical number of points, and then three points (blue circle) to a Bezier curve. In this case the
Bezier is the second curve, and it uses the last point of the first curve to complete the minimum number of
control points that it requires.

However, to solve this kind of problem was necessary only to work out a simple calculation about the
number of control points of the curve that the user is drawing, based on the type of the curve.

Weitere ähnliche Inhalte

Was ist angesagt?

A concept of graphics
A concept of graphicsA concept of graphics
A concept of graphicsmsouravmishra
 
A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...
A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...
A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...IJEACS
 
Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem) Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem) Saksham Saxena
 
Build Your Own 3D Scanner: The Mathematics of 3D Triangulation
Build Your Own 3D Scanner: The Mathematics of 3D TriangulationBuild Your Own 3D Scanner: The Mathematics of 3D Triangulation
Build Your Own 3D Scanner: The Mathematics of 3D TriangulationDouglas Lanman
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsMichael Heron
 
Build Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: ConclusionBuild Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: ConclusionDouglas Lanman
 
Particle tracking
Particle trackingParticle tracking
Particle trackingbagustris
 
CenterForDomainSpecificComputing-Poster
CenterForDomainSpecificComputing-PosterCenterForDomainSpecificComputing-Poster
CenterForDomainSpecificComputing-PosterYunming Zhang
 
How do self driving cars detects lane lines so easily
How do self driving cars detects lane lines so easilyHow do self driving cars detects lane lines so easily
How do self driving cars detects lane lines so easilyANOLYTICS
 
ANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentationANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentationAnish Patel
 
Computer graphics file
Computer graphics fileComputer graphics file
Computer graphics fileaman1001
 
Auto cad introduction sas institute
Auto cad introduction sas instituteAuto cad introduction sas institute
Auto cad introduction sas instituteShusmita Chauhan
 
Build Your Own 3D Scanner: Introduction
Build Your Own 3D Scanner: IntroductionBuild Your Own 3D Scanner: Introduction
Build Your Own 3D Scanner: IntroductionDouglas Lanman
 

Was ist angesagt? (20)

A concept of graphics
A concept of graphicsA concept of graphics
A concept of graphics
 
A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...
A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...
A Detailed Analysis on Feature Extraction Techniques of Panoramic Image Stitc...
 
Image formation
Image formationImage formation
Image formation
 
Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem) Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem)
 
Build Your Own 3D Scanner: The Mathematics of 3D Triangulation
Build Your Own 3D Scanner: The Mathematics of 3D TriangulationBuild Your Own 3D Scanner: The Mathematics of 3D Triangulation
Build Your Own 3D Scanner: The Mathematics of 3D Triangulation
 
Java fx 3d
Java fx 3dJava fx 3d
Java fx 3d
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D Graphics
 
sduGroupEvent
sduGroupEventsduGroupEvent
sduGroupEvent
 
What is computer graphics
What is computer graphicsWhat is computer graphics
What is computer graphics
 
Build Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: ConclusionBuild Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: Conclusion
 
Particle tracking
Particle trackingParticle tracking
Particle tracking
 
CenterForDomainSpecificComputing-Poster
CenterForDomainSpecificComputing-PosterCenterForDomainSpecificComputing-Poster
CenterForDomainSpecificComputing-Poster
 
How do self driving cars detects lane lines so easily
How do self driving cars detects lane lines so easilyHow do self driving cars detects lane lines so easily
How do self driving cars detects lane lines so easily
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
ANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentationANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentation
 
Computer graphics file
Computer graphics fileComputer graphics file
Computer graphics file
 
Auto cad introduction sas institute
Auto cad introduction sas instituteAuto cad introduction sas institute
Auto cad introduction sas institute
 
Build Your Own 3D Scanner: Introduction
Build Your Own 3D Scanner: IntroductionBuild Your Own 3D Scanner: Introduction
Build Your Own 3D Scanner: Introduction
 
Datt2500 week 02
Datt2500 week 02Datt2500 week 02
Datt2500 week 02
 
Normal Mapping / Computer Graphics - IK
Normal Mapping / Computer Graphics - IKNormal Mapping / Computer Graphics - IK
Normal Mapping / Computer Graphics - IK
 

Ähnlich wie A graphic library and an application for simple curve manipolation

Extraction of Buildings from Satellite Images
Extraction of Buildings from Satellite ImagesExtraction of Buildings from Satellite Images
Extraction of Buildings from Satellite ImagesAkanksha Prasad
 
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203tutorialsruby
 
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203tutorialsruby
 
JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2Jonathan Westlake
 
Machine learning Exam.pdf
Machine learning Exam.pdfMachine learning Exam.pdf
Machine learning Exam.pdfChitra Krystle
 
Computer Aided Solid Modelling
Computer Aided Solid ModellingComputer Aided Solid Modelling
Computer Aided Solid ModellingDibyajyoti Laha
 
TAO Fayan_Canvas design by tcltk_Final report
TAO Fayan_Canvas design by tcltk_Final reportTAO Fayan_Canvas design by tcltk_Final report
TAO Fayan_Canvas design by tcltk_Final reportFayan TAO
 
Human Head Counting and Detection using Convnets
Human Head Counting and Detection using ConvnetsHuman Head Counting and Detection using Convnets
Human Head Counting and Detection using Convnetsrahulmonikasharma
 
[Pro forma] - production log
[Pro forma] - production log[Pro forma] - production log
[Pro forma] - production logcharles-stick
 
Rocket Editor (Recovered).pptx
Rocket Editor (Recovered).pptxRocket Editor (Recovered).pptx
Rocket Editor (Recovered).pptxSkyknightBeoulve1
 
Convolutional neural network complete guide
Convolutional neural network complete guideConvolutional neural network complete guide
Convolutional neural network complete guideMLTUT
 
AutoCAD Lab Manual
AutoCAD Lab ManualAutoCAD Lab Manual
AutoCAD Lab ManualCynthia King
 
lecture_slides_esteem2019-231.pdf
lecture_slides_esteem2019-231.pdflecture_slides_esteem2019-231.pdf
lecture_slides_esteem2019-231.pdfLukeaugustus2
 
Programming in matlab lesson5
Programming in matlab lesson5Programming in matlab lesson5
Programming in matlab lesson5najmah17
 
2D & 3D Modelling with Mathematica
2D & 3D Modelling with Mathematica2D & 3D Modelling with Mathematica
2D & 3D Modelling with MathematicaMiles Ford
 
Please make the complete program, distinguishing between each class .pdf
Please make the complete program, distinguishing between each class .pdfPlease make the complete program, distinguishing between each class .pdf
Please make the complete program, distinguishing between each class .pdffaxteldelhi
 

Ähnlich wie A graphic library and an application for simple curve manipolation (20)

Extraction of Buildings from Satellite Images
Extraction of Buildings from Satellite ImagesExtraction of Buildings from Satellite Images
Extraction of Buildings from Satellite Images
 
Final report
Final reportFinal report
Final report
 
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
 
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
An%20Intermediate%20Google%20SketchUp%20Tutorial%20-%20Part%203
 
JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2
 
Machine learning Exam.pdf
Machine learning Exam.pdfMachine learning Exam.pdf
Machine learning Exam.pdf
 
Computer Aided Solid Modelling
Computer Aided Solid ModellingComputer Aided Solid Modelling
Computer Aided Solid Modelling
 
Icem102
Icem102Icem102
Icem102
 
TAO Fayan_Canvas design by tcltk_Final report
TAO Fayan_Canvas design by tcltk_Final reportTAO Fayan_Canvas design by tcltk_Final report
TAO Fayan_Canvas design by tcltk_Final report
 
Human Head Counting and Detection using Convnets
Human Head Counting and Detection using ConvnetsHuman Head Counting and Detection using Convnets
Human Head Counting and Detection using Convnets
 
[Pro forma] - production log
[Pro forma] - production log[Pro forma] - production log
[Pro forma] - production log
 
Rocket Editor (Recovered).pptx
Rocket Editor (Recovered).pptxRocket Editor (Recovered).pptx
Rocket Editor (Recovered).pptx
 
Convolutional neural network complete guide
Convolutional neural network complete guideConvolutional neural network complete guide
Convolutional neural network complete guide
 
Adobe photoshop
Adobe photoshopAdobe photoshop
Adobe photoshop
 
AutoCAD Lab Manual
AutoCAD Lab ManualAutoCAD Lab Manual
AutoCAD Lab Manual
 
CAE_s1233587
CAE_s1233587CAE_s1233587
CAE_s1233587
 
lecture_slides_esteem2019-231.pdf
lecture_slides_esteem2019-231.pdflecture_slides_esteem2019-231.pdf
lecture_slides_esteem2019-231.pdf
 
Programming in matlab lesson5
Programming in matlab lesson5Programming in matlab lesson5
Programming in matlab lesson5
 
2D & 3D Modelling with Mathematica
2D & 3D Modelling with Mathematica2D & 3D Modelling with Mathematica
2D & 3D Modelling with Mathematica
 
Please make the complete program, distinguishing between each class .pdf
Please make the complete program, distinguishing between each class .pdfPlease make the complete program, distinguishing between each class .pdf
Please make the complete program, distinguishing between each class .pdf
 

Mehr von graphitech

A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationgraphitech
 
Rescue Mission
Rescue MissionRescue Mission
Rescue Missiongraphitech
 
Rescue Mission
Rescue MissionRescue Mission
Rescue Missiongraphitech
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainabilitygraphitech
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainabilitygraphitech
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screensgraphitech
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screensgraphitech
 
Graph Matching
Graph MatchingGraph Matching
Graph Matchinggraphitech
 
Shape Analysis
Shape AnalysisShape Analysis
Shape Analysisgraphitech
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Librarygraphitech
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Librarygraphitech
 
WebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World WindWebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World Windgraphitech
 
Street Builder
Street BuilderStreet Builder
Street Buildergraphitech
 
Street Builder
Street BuilderStreet Builder
Street Buildergraphitech
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Windgraphitech
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Windgraphitech
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modificationgraphitech
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modificationgraphitech
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Projectgraphitech
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Projectgraphitech
 

Mehr von graphitech (20)

A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 
Rescue Mission
Rescue MissionRescue Mission
Rescue Mission
 
Rescue Mission
Rescue MissionRescue Mission
Rescue Mission
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainability
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainability
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screens
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screens
 
Graph Matching
Graph MatchingGraph Matching
Graph Matching
 
Shape Analysis
Shape AnalysisShape Analysis
Shape Analysis
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Library
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Library
 
WebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World WindWebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World Wind
 
Street Builder
Street BuilderStreet Builder
Street Builder
 
Street Builder
Street BuilderStreet Builder
Street Builder
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Wind
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Wind
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modification
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modification
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Project
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Project
 

A graphic library and an application for simple curve manipolation

  • 1. hahahFinal Project Principles of Computer Graphics 2010 Project report Student: Umberto Di Staso – 142685 Professor: Raffaele de Amicis 7/8/2010
  • 2.
  • 3. GENERAL SYSTEM OVERVIEW The project consists in a software that uses a developed library in the Intermediate project to construct complex functionalities. The functional asked requisites are: 1. Load a picture in background. 2. Generate different kinds of curves using points generated by mouse. a. Hermite Spline, b. Bezier Spline, c. BSpline, d. Lagrange. In this way we can isolate the perimeter of the previous loaded picture. 3. Move single points using the mouse drag property. 4. Select multi points and move them together. 5. Curves must be connected to each other. 6. Save the composition of curves in a file. 7. Load the composition of curves saved before. 8. Load a point file ad interpolate the points using the available curves. In this way we can observe the differences generated when same points are interpolated by different kind curves. 9. Change in real time the kind of curve that interpolates a set of points. Below we can see the use case diagram that includes the functionality requisites listed before.
  • 4. Class Diagram: The application consists in a set of classes connected to a Main class. As we can see, there are two kinds of listeners associated to the principal class: 1. MouseListener: contains the method used to capture mouse events. Thanks to this kind of listener I can intercept events used to add or drag points over the screen. 2. EventListener: core listener of program. It contains all the methods I have used to manage the functionalities provided by JOGL. As we can see, the developed library and some others classes are used in this listener. There are also some important classes used in the software: 1. Texture: used to generate the texture that I have put in the background of the screen. 2. GUI: generates the Graphical User Interface of the software.
  • 5. FINAL PROJECT GUI The Graphical User Interface is completely designed by using Swing components. The reason of this choice is simply because I needed objects like buttons, radio buttons and checkboxes to manage the functionalities provided by the application. As we can see in the image above, the software gives us a large set of choices used for different kinds of operations: 1. Picture canvas: this area is the portion of the screen that is used to visualize the image that we have loaded before, and set, using the mouse, the points in which the set curve will pass. 2. Clear button: this button clears the picture canvas of any curve we have painted before. 3. Curves set: set of curves that we own: a. Bezier spline, b. Lagrange, c. Hermite spline, d. BSpline. 4. Delete last point: deletes the last point of the last curve. 5. Move points: option used when we want to move the points of a specific curve (set using the combo box #8). 6. Ctrl select: this option works with the move points option. It allows us to select precise points of a specific curve, and move it all together.
  • 6. 7. Change curve: this option allows us to change in real time the kind of a set curve. For example, we can change a Bezier spline in a Lagrange and vice versa. 8. Select curve: this combo box is used to set the curve we want to work with. It operates through options 5-6-7. 9. Load image: used to load any image in background. 10. Load a blank image: used to load a white background image. In this way we can observe in a better manner the result of our curves. 11. Restore default image: thanks to this option, we can restore the default image in background. Default image is simply a cup. 12. Load point file: with this option we can load a point file from our hard disk. The point file will be interpolated using the curves showed before. 13. Load a curve: through this option we can restore a curve painted before. When the curve is restored, we can add points and extend the restored curve. 14. Save curve: produces the file that will be loaded by using the option showed before. 15. Hide points: allow us to hide all points over the screen. Using this option we can see better ours results.
  • 7. FINAL PROJECT AT WORK In this section I want to show, using some images, how the system works. The first image shows how we can isolate the perimeter of the default image using the tools we have. Now we can hide all points to see better the final result.
  • 8. The final step is load a blank background image for emphasize the curves. Next image shows how a curve can be changed in any type of curve using the “change curve” option.
  • 9. As we have seen, same points can be interpolated by different curves simply by checking the “change curve option”, setting the curve number that we want to change using the combo box and, at last, selecting the final curve. It is possible that a curve can not be changed in another curve, e.g. a BSpline with 3 control points can not be interpolated by a Bezier, because it requires 4 control points. In this case, no changes will be done, and the original BSpline remains the same. The next picture shows how users can move points in three different ways. The simplest one is the classic “drag” option. It will be enabled when “move points” is selected, and a single point on the picture is dragged. If I drag my mouse, starting where there are not pints, multi point selection will be enabled. This option draws a purple rectangle exactly when I click the mouse and ends when I release the left mouse button. The points inside this area will be moved all together. The last option is called “ctrl selection”. It permits to drag points that are not adjacent, simply by selecting the points that I want to move and drag one of them. When the points are enabled with ctrl selection, they change color, which is really useful because in this way I can see where ctrl selection is enabled.
  • 10. The last functionality of the system is dedicated to load a point file and interpolate the points using all the curves that I have. In particular, I when a point file is loaded, the curves that will be generated are: 1. Bezier, 2. Hermite Spline, 3. BSpline with 2-3-4 degree. No Lagrange curve is used and the motivation is simple: processing this kind of curve with a very high number of points requests too many resources from the pc where the program is running. Elements of the file points must be listed in this form: [X, Y] Where X and Y are the coordinates of a point. For example: [0.3502722323049001,-0.7918781725888325] Is a point inserted in to the file enclosed in the project.
  • 11. As we did before, we can hide all points It is really interesting to notice that the difference between the three kinds of curves that I have used is minimal: the general path is the same, and there are no relevance differences.
  • 12. CONCLUSIONS During the implementation of this project I have used many materials of the library that have been developed during the Intermediate Project. Major problematic was born when the system checked if the number of points that composed any type of curves was correct: different types of curves need different numbers of points. Another variable that can be found is if a curve is painted at first or not. To better understand this kind of problematic could be useful have a look at the image below. First curve is a classic Bezier: it requires simply four control points. The second image shows how two curves can be consecutive: at first three points (yellow circle) belong to a Lagrange curve, that does not require a critical number of points, and then three points (blue circle) to a Bezier curve. In this case the Bezier is the second curve, and it uses the last point of the first curve to complete the minimum number of control points that it requires. However, to solve this kind of problem was necessary only to work out a simple calculation about the number of control points of the curve that the user is drawing, based on the type of the curve.