Package com.eteks.sweethome3d.model

Examples of com.eteks.sweethome3d.model.HomeEnvironment


                                                     int lightColor,
                                                     float wallsAlpha, Home home) {
    ObserverCamera observerCamera = home.getObserverCamera();
    assertEquals("Wrong field of view", cameraFieldOfView, observerCamera.getFieldOfView());
    assertEquals("Wrong height", cameraHeight, observerCamera.getHeight());
    HomeEnvironment homeEnvironment = home.getEnvironment();
    assertEquals("Wrong ground color", groundColor, homeEnvironment.getGroundColor());
    if (groundTexture == null) {
      assertEquals("Wrong ground texture", groundTexture, homeEnvironment.getGroundTexture());
    } else {
      assertEquals("Wrong ground texture", groundTexture.getName(), homeEnvironment.getGroundTexture().getName());
    }
    assertEquals("Wrong sky color", skyColor, homeEnvironment.getSkyColor());
    assertEquals("Wrong brightness", lightColor, homeEnvironment.getLightColor());
    assertEquals("Wrong transparency", wallsAlpha, home.getEnvironment().getWallsAlpha());
  }
View Full Code Here


  /**
   * Remove all listeners bound to home that updates 3D scene objects.
   */
  private void removeHomeListeners() {
    this.home.removePropertyChangeListener(Home.Property.CAMERA, this.homeCameraListener);
    HomeEnvironment homeEnvironment = this.home.getEnvironment();
    homeEnvironment.removePropertyChangeListener(HomeEnvironment.Property.SKY_COLOR, this.skyColorListener);
    homeEnvironment.removePropertyChangeListener(HomeEnvironment.Property.SKY_TEXTURE, this.skyColorListener);
    homeEnvironment.removePropertyChangeListener(HomeEnvironment.Property.GROUND_COLOR, this.groundColorAndTextureListener);
    homeEnvironment.removePropertyChangeListener(HomeEnvironment.Property.GROUND_TEXTURE, this.groundColorAndTextureListener);
    homeEnvironment.removePropertyChangeListener(HomeEnvironment.Property.LIGHT_COLOR, this.lightColorListener);
    homeEnvironment.removePropertyChangeListener(HomeEnvironment.Property.WALLS_ALPHA, this.wallsAlphaListener);
    homeEnvironment.removePropertyChangeListener(HomeEnvironment.Property.DRAWING_MODE, this.drawingModeListener);
    this.home.getCamera().removePropertyChangeListener(this.cameraChangeListener);
    this.home.removeWallsListener(this.wallListener);
    for (Wall wall : this.home.getWalls()) {
      wall.removePropertyChangeListener(this.wallChangeListener);
    }
View Full Code Here

          public void propertyChange(PropertyChangeEvent ev) {
            ground3D.update();
            clearPrintedImageCache();
          }
        };
      HomeEnvironment homeEnvironment = this.home.getEnvironment();
      homeEnvironment.addPropertyChangeListener(
          HomeEnvironment.Property.GROUND_COLOR, this.groundColorAndTextureListener);
      homeEnvironment.addPropertyChangeListener(
          HomeEnvironment.Property.GROUND_TEXTURE, this.groundColorAndTextureListener);
    }
   
    return transformGroup;
  }
View Full Code Here

   */
  protected void updateProperties() {
    setObserverFieldOfViewInDegrees((int)(Math.round(Math.toDegrees(
        this.home.getObserverCamera().getFieldOfView())) + 360) % 360);
    setObserverHeight(this.home.getObserverCamera().getZ() * 15 / 14);
    HomeEnvironment homeEnvironment = this.home.getEnvironment();
    setGroundColor(homeEnvironment.getGroundColor());
    HomeTexture groundTexture = homeEnvironment.getGroundTexture();
    getGroundTextureController().setTexture(groundTexture);
    if (groundTexture != null) {
      setGroundPaint(EnvironmentPaint.TEXTURED);
    } else {
      setGroundPaint(EnvironmentPaint.COLORED);
    }
    setSkyColor(homeEnvironment.getSkyColor());
    HomeTexture skyTexture = homeEnvironment.getSkyTexture();
    getSkyTextureController().setTexture(skyTexture);
    if (skyTexture != null) {
      setSkyPaint(EnvironmentPaint.TEXTURED);
    } else {
      setSkyPaint(EnvironmentPaint.COLORED);
    }
    setLightColor(homeEnvironment.getLightColor());
    setWallsAlpha(homeEnvironment.getWallsAlpha());
  }
View Full Code Here

    int   lightColor  = getLightColor();
    float wallsAlpha = getWallsAlpha();

    float oldObserverCameraFieldOfView = this.home.getObserverCamera().getFieldOfView();
    float oldObserverCameraZ = this.home.getObserverCamera().getZ();
    HomeEnvironment homeEnvironment = this.home.getEnvironment();
    int   oldGroundColor = homeEnvironment.getGroundColor();
    HomeTexture oldGroundTexture = homeEnvironment.getGroundTexture();
    int   oldSkyColor = homeEnvironment.getSkyColor();
    HomeTexture oldSkyTexture = homeEnvironment.getSkyTexture();
    int   oldLightColor = homeEnvironment.getLightColor();
    float oldWallsAlpha = homeEnvironment.getWallsAlpha();
   
    // Apply modification
    doModify3DAttributes(home, observerCameraFieldOfView, observerCameraZ,
        groundColor, groundTexture, skyColor, skyTexture, lightColor, wallsAlpha);
    if (this.undoSupport != null) {
View Full Code Here

                                           int skyColor, HomeTexture skyTexture,
                                           int lightColor, float wallsAlpha) {
    ObserverCamera observerCamera = home.getObserverCamera();
    observerCamera.setFieldOfView(observerCameraFieldOfView);
    observerCamera.setZ(observerCameraZ);
    HomeEnvironment homeEnvironment = home.getEnvironment();
    homeEnvironment.setGroundColor(groundColor);
    homeEnvironment.setGroundTexture(groundTexture);
    homeEnvironment.setSkyColor(skyColor);
    homeEnvironment.setSkyTexture(skyTexture);
    homeEnvironment.setLightColor(lightColor);
    homeEnvironment.setWallsAlpha(wallsAlpha);
  }
View Full Code Here

  /**
   * Updates edited properties from the photo creation preferences.
   */
  protected void updateProperties() {
    HomeEnvironment homeEnvironment = this.home.getEnvironment();
    setAspectRatio(homeEnvironment.getPhotoAspectRatio());
    setWidth(homeEnvironment.getPhotoWidth(), false);
    setHeight(homeEnvironment.getPhotoHeight(), false);
    setQuality(homeEnvironment.getPhotoQuality());
    setTime(this.home.getCamera().getTime());
    setLens(this.home.getCamera().getLens());
    setCeilingLightColor(homeEnvironment.getCeillingLightColor());
    this.view3DAspectRatio = 1;
  }
View Full Code Here

  /**
   * Updates edited properties from the video creation preferences.
   */
  protected void updateProperties() {
    HomeEnvironment homeEnvironment = this.home.getEnvironment();
    setAspectRatio(homeEnvironment.getVideoAspectRatio());
    setFrameRate(homeEnvironment.getVideoFrameRate());
    setWidth(homeEnvironment.getVideoWidth(), false);
    setHeight(homeEnvironment.getVideoHeight(), false);
    setQuality(homeEnvironment.getVideoQuality());
    List<Camera> videoCameraPath = homeEnvironment.getVideoCameraPath();
    setCameraPath(videoCameraPath);
    setTime(videoCameraPath.isEmpty()
        ? this.home.getCamera().getTime()
        : videoCameraPath.get(0).getTime());
    setCeilingLightColor(homeEnvironment.getCeillingLightColor());
  }
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.model.HomeEnvironment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.