Speed up arc rendering.
Jean-baptiste Silvy [Tue, 29 Apr 2008 14:08:19 +0000 (14:08 +0000)]
scilab/modules/renderer/src/cpp/arcDrawing/DrawableArc.cpp
scilab/modules/renderer/src/cpp/arcDrawing/DrawableArc.h
scilab/modules/renderer/src/java/org/scilab/modules/renderer/arcDrawing/ArcFillDrawerGL.java
scilab/modules/renderer/src/java/org/scilab/modules/renderer/arcDrawing/ArcLineDrawerGL.java

index 1ba652c..053fcae 100644 (file)
@@ -29,6 +29,11 @@ DrawableArc::~DrawableArc( void )
   
 }
 /*---------------------------------------------------------------------------------*/
+void DrawableArc::parentSubwinChanged( void )
+{
+  m_bNeedRedraw = true;
+}
+/*---------------------------------------------------------------------------------*/
 void DrawableArc::draw( void )
 {
   initializeDrawing() ;
index 5f19747..74705b5 100644 (file)
@@ -33,6 +33,11 @@ public:
   virtual ~DrawableArc( void ) ;
 
   /**
+   * Text must be updated whenever the parent axes changed
+   */
+  virtual void parentSubwinChanged( void );
+
+  /**
    * Add a rendering algorithm
    */
   virtual void addDrawingStrategy( DrawArcStrategy * strategy ) = 0 ;
index 9c7f549..f113fa1 100644 (file)
@@ -39,35 +39,6 @@ public class ArcFillDrawerGL extends FillDrawerGL implements ArcDrawerStrategy {
        }
        
        /**
-        * Quicly call the parent figure
-        * @param parentFigureIndex index of parent figure
-        */
-       @Override
-       public void show(int parentFigureIndex) {
-               drawArc();
-       }
-       
-       
-       /**
-        * Create a new display list
-        * Each JoGL call will be saved in the DL
-        * until endRecordDL is called
-        */
-       @Override
-       protected void startRecordDL() {
-               // No DL usable
-       }
-       
-       /**
-        * End the recoding of a display list.
-        * Need to be called after a startRecordDL      
-        */
-       @Override
-       protected void endRecordDL() {
-               // No DL usable
-       }
-       
-       /**
         * create the display list for the arc
         * @param centerX X coordinate of the arc center
         * @param centerY Y coordinate of the arc center
@@ -92,7 +63,8 @@ public class ArcFillDrawerGL extends FillDrawerGL implements ArcDrawerStrategy {
                Vector3D semiMinorAxis = new Vector3D(semiMinorAxisX, semiMinorAxisY, semiMinorAxisZ);
                Vector3D semiMajorAxis = new Vector3D(semiMajorAxisX, semiMajorAxisY, semiMajorAxisZ);
        
-               drawer = getParentFigureGL().getArcRendererFactory().createArcFillRenderer(center, semiMinorAxis, semiMajorAxis, startAngle, endAngle);
+               ArcRendererFactory arcFactory = getParentFigureGL().getArcRendererFactory();
+               drawer = arcFactory.createArcFillRenderer(center, semiMinorAxis, semiMajorAxis, startAngle, endAngle);
                
                drawArc();
                
index 165b5c2..bf750f5 100644 (file)
@@ -71,33 +71,6 @@ public class ArcLineDrawerGL extends LineDrawerGL implements ArcDrawerStrategy {
        }
        
        /**
-        * Quicly call the parent figure
-        * @param parentFigureIndex index of parent figure
-        */
-       @Override
-       public void show(int parentFigureIndex) {
-               drawArc();
-       }
-       
-       
-       /**
-        * Create a new display list
-        * Each JoGL call will be saved in the DL
-        * until endRecordDL is called
-        */
-       protected void startRecordDL() {
-               // No DL usable.
-       }
-       
-       /**
-        * End the recoding of a display list.
-        * Need to be called after a startRecordDL      
-        */
-       protected void endRecordDL() {
-               // No DL usable.
-       }
-       
-       /**
         * Call gl routine to draw to outline of the arc.
         */
        public void drawArc() {