Class TestObjet

java.lang.Object
one.empty3.library.core.testing.TestObjet
All Implemented Interfaces:
Runnable, Test
Direct Known Subclasses:
AnneauDeSpheresQuiTournent, CubesQuiTombent, Scene1, TestAnneau, TestBezierN, TestCameraEnMouvement, TestCameraEnMouvementCylindre, TestCameraEnMouvementRandomTriangles, TestCoeur1, TestCParamBSpline, TestEarth2, TestGDXBSpline1, TestObjetStub, TestObjetSub, TestPH, TestPH1, TestSomething3D, TestSpheres

public abstract class TestObjet extends Object implements Test, Runnable
The TestObjet class provides functionality for testing objects in the library.
  • Field Details

  • Constructor Details

    • TestObjet

      public TestObjet()
      The TestObjet class represents an object used for testing purposes.
    • TestObjet

      public TestObjet(ArrayList<TestInstance.Parameter> params)
    • TestObjet

      public TestObjet(boolean binit)
  • Method Details

    • z

      protected ZBufferImpl z()
      Get the ZBuffer implementation used by the class.
      Returns:
      The ZBuffer implementation used by the class
    • setProperties

      public void setProperties(Properties p)
    • getDataWriter

      public ExportAnimationData getDataWriter()
    • getIdxFilm

      public int getIdxFilm()
    • getSubfolder

      public File getSubfolder()
    • setResolution

      public void setResolution(int x, int y)
    • img

      public BufferedImage img()
    • startNewMovie

      public void startNewMovie()
    • isAviOpen

      public boolean isAviOpen()
    • setAviOpen

      public void setAviOpen(boolean aviOpen)
    • getGenerate

      public boolean getGenerate(int GENERATE)
    • getO

      public RegisterOutput getO()
    • afterRenderFrame

      public abstract void afterRenderFrame()
    • applyTemplate

      public String applyTemplate(String template, Properties properties)
    • camera

      public Camera camera()
      Specified by:
      camera in interface Test
    • camera

      public void camera(Camera c)
      Specified by:
      camera in interface Test
    • D3

      public boolean D3()
    • description

      public void description(String d)
    • directory

      public File directory()
    • ecrireImage

      protected void ecrireImage(RenderedImage ri, String type, File fichier)
    • exportFrame

      public void exportFrame(String format, String filename) throws IOException
      Throws:
      IOException
    • finit

      public abstract void finit() throws Exception
      Throws:
      Exception
    • frame

      public int frame()
    • getFile

      public File getFile()
    • getFilename

      public String getFilename()
    • setFilename

      public void setFilename(String fn)
    • getGenerate

      public int getGenerate()
    • setGenerate

      public void setGenerate(int generate)
    • getInitParams

      public ArrayList<TestInstance.Parameter> getInitParams()
      Specified by:
      getInitParams in interface Test
    • getMaxFrames

      public int getMaxFrames()
    • setMaxFrames

      public void setMaxFrames(int maxFrames)
    • getResx

      public int getResx()
    • setResx

      @Deprecated public void setResx(int resx)
      Deprecated.
    • getResy

      public int getResy()
    • setResy

      @Deprecated public void setResy(int resy)
      Deprecated.
    • ginit

      public abstract void ginit()
    • isometrique

      public void isometrique(boolean isISO)
    • isometrique

      public void isometrique(boolean isISO, boolean noZoom)
    • isPause

      public boolean isPause()
    • isPauseActive

      public boolean isPauseActive()
    • isStructure

      public boolean isStructure()
    • setStructure

      public void setStructure(boolean structure)
    • loop

      public boolean loop()
      Specified by:
      loop in interface Test
    • loop

      public void loop(boolean isLooping)
      Specified by:
      loop in interface Test
    • nextFrame

      public boolean nextFrame()
      Specified by:
      nextFrame in interface Test
    • nextFrame2UnknownDiplicate

      public boolean nextFrame2UnknownDiplicate()
    • PAUSE

      public void PAUSE()
    • publishResult

      public void publishResult()
      Publishes the test results if the publish flag is set to true.

      This method creates a new thread to publish the test results by calling the ShowTestResult class, passing in the necessary parameters. The publishing process includes setting the image container, the test object, and starting the thread for execution.

      This method does not return any value.

      Note: The publish flag needs to be set to true in order for the test results to be published.

      Specified by:
      publishResult in interface Test
    • setPublish

      public void setPublish(boolean publish)
    • publishResult

      public void publishResult(boolean publish)
      Sets the publish flag of the object.
      Parameters:
      publish - The boolean flag indicating if the test results should be published sets to false for a console mode or true for GUI process controls.
    • reportException

      public void reportException(Exception ex)
    • reportPause

      public void reportPause(boolean phase)
    • reportStop

      public void reportStop()
    • reportSuccess

      public void reportSuccess(File film)
    • copyResources

      public boolean copyResources()
    • addAudioFile

      public void addAudioFile(File audio)
    • initCompiler

      public void initCompiler()
    • run

      public void run()
      Runs the animation rendering process.

      This method initializes the rendering environment, generates images and models, saves them to files, and performs post-rendering actions such as publishing and generating movies. It also handles pausing, frame advancement, audio synchronization, and error reporting.

      Specified by:
      run in interface Runnable
      Specified by:
      run in interface Test
      Throws:
      RuntimeException - if an I/O error occurs while saving files
    • saveBMood

      public void saveBMood(boolean b)
    • scene

      public Scene scene()
      Returns the scene associated with this object.
      Specified by:
      scene in interface Test
      Returns:
      the scene associated with this object
    • paintingAct

      public void paintingAct(Representable representable, PaintingAct pa)
    • closeView

      public void closeView()
    • scene

      public void scene(Scene load)
      Sets the scene associated with this object.
      Parameters:
      load - The scene to be set
    • set3D

      public void set3D(boolean b3D)
    • setCouleurFond

      public void setCouleurFond(ITexture tColor)
    • setDynParameter

      public boolean setDynParameter(TestInstance.Parameter parameter)
    • setFileExtension

      public void setFileExtension(String ext)
    • STOP

      public void STOP()
    • testScene

      public abstract void testScene() throws Exception
      Represents a test scene in the TestObjet class.

      This abstract method should be implemented by subclasses to define the specific test scene logic. It is responsible for performing all the necessary steps required for the test, such as initializing the object, setting up parameters, generating images or models, and handling other specific operations as needed.

      This method can throw an Exception if any error occurs during the test scene execution.

      Specified by:
      testScene in interface Test
      Throws:
      Exception - if an error occurs during the test scene execution.
    • testScene

      public void testScene(File f) throws Exception
      Specified by:
      testScene in interface Test
      Throws:
      Exception
    • writeOnPictureAfterZ

      public void writeOnPictureAfterZ(BufferedImage bi)
    • writeOnPictureBeforeZ

      public void writeOnPictureBeforeZ(BufferedImage bi)
    • getFolder

      public String getFolder()
    • unterminable

      public void unterminable(boolean b)
      Sets the unterminable flag of the object.
      Parameters:
      b - the boolean flag indicating if the object is unterminable
    • getZ

      public ZBuffer getZ()
      Get the ZBuffer implementation used by the class.
      Specified by:
      getZ in interface Test
      Returns:
      The ZBuffer implementation used by the class
    • onTextureEnds

      public void onTextureEnds(ITexture texture, int texture_event)
      Specified by:
      onTextureEnds in interface Test
    • onMaxFrame

      public void onMaxFrame(int maxFramesEvent)
      Specified by:
      onMaxFrame in interface Test
    • getInstance

      public TestObjet getInstance() throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • getDimension

      public Resolution getDimension()
    • setDimension

      public void setDimension(Resolution dimension)
    • setName

      public void setName(String name)
    • v2main

      public Color v2main()
    • getWrittenFile

      public File getWrittenFile()
    • getFps

      public int getFps()
    • setFps

      public void setFps(int fps)
    • setZ

      public void setZ(ZBufferImpl z)
    • getDir

      public File getDir()
    • setThreadGLafter

      public void setThreadGLafter(Thread thread)