Skip to content
Snippets Groups Projects
Commit 779b0b14 authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Fixes

parent b22caa28
No related branches found
No related tags found
No related merge requests found
......@@ -373,9 +373,6 @@ public final class ProjectTopComp extends TopComponent {
this.singleFaceTabs.put(face, newTab);
newTab.open();
newTab.requestActive();
//newTab.getCanvas().getGLCanvas().display();
//newTab.repaint();
//newTab.getCanvas().getGLCanvas().setVisible(true);
}
}
......@@ -25,26 +25,6 @@ public class Camera {
this.center.set(0, 0, 0);
}
/**
* Changes the camera position
* @param pos new position
*/
/*
public void setPosition(Vector3d pos) {
currentPosition.set(pos);
}
*/
/**
* Sets default camera position
*/
/*
public void setDefaultPosition() {
currentPosition.set(Camera.DEFAULT_POSITION);
}
*/
/**
* Returns center of the scene.
*
......@@ -165,11 +145,12 @@ public class Camera {
* @param yShift yShift
*/
public void move(double xShift, double yShift) {
Vector3d xAxis = getXaxis();
Vector3d yAxis = getYaxis();
Vector3d shift = new Vector3d(xAxis);
shift.scale(xShift + yShift);
yAxis.scale(yShift);
Vector3d shift = getXaxis();
shift.scale(xShift);
shift.add(yAxis);
Vector3d camera = new Vector3d(currentPosition);
camera.add(shift);
......
......@@ -8,7 +8,6 @@ import static com.jogamp.opengl.GL2GL3.GL_FILL;
import static com.jogamp.opengl.GL2GL3.GL_LINE;
import com.jogamp.opengl.glu.GLU;
import cz.fidentis.analyst.mesh.core.MeshFacet;
import cz.fidentis.analyst.mesh.core.MeshModel;
import java.util.ArrayList;
import java.util.List;
import javax.vecmath.Vector3d;
......@@ -177,17 +176,6 @@ public class Scene {
this.wireframe = false;
}
/**
* Renders the whole mesh model.
*
* @param model Mesh model to be rendered
*/
protected void renderMeshModel(MeshModel model) {
for (int i = 0; i < model.getFacets().size(); i++) {
renderFacet(model.getFacets().get(i));
}
}
/**
* Loops through the facet and render all the vertices as they are stored in corner table
*
......
......@@ -482,12 +482,14 @@ public class Canvas extends javax.swing.JPanel {
private void whiteBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_whiteBackroundButtonMouseClicked
scene.setBrightBackground();
scene.renderScene();
whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvasPressed.png")));
blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvas.png")));
}//GEN-LAST:event_whiteBackroundButtonMouseClicked
private void blackBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_blackBackroundButtonMouseClicked
scene.setDarkBackground();
scene.renderScene();
whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvas.png")));
blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvasPressed.png")));
}//GEN-LAST:event_blackBackroundButtonMouseClicked
......
......@@ -26,24 +26,24 @@ public class CanvasListener implements GLEventListener {
@Override
public void init(GLAutoDrawable glad) {
System.out.println("CanvasListener.init");
//System.out.println("CanvasListener.init");
canvas.getScene().initSceneGLContext(glad.getGL().getGL2());
}
@Override
public void dispose(GLAutoDrawable glad) {
System.out.println("CanvasListener.dispose");
//System.out.println("CanvasListener.dispose");
}
@Override
public void display(GLAutoDrawable glad) {
System.out.println("CanvasListener.display " + this.toString());
//System.out.println("CanvasListener.display " + this.toString());
canvas.getScene().renderScene();
}
@Override
public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
System.out.println("CanvasListener.reshape");
//System.out.println("CanvasListener.reshape");
canvas.getScene().setViewport(x, y, width, height);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment