提交 9f5857a9 编写于 作者: M Mathieu Bastian

Migrate Visualization to JOGL2.

上级 0f0da1be
......@@ -73,14 +73,14 @@
<artifactId>org-openide-util</artifactId>
</dependency>
<dependency>
<groupId>com.sun.opengl</groupId>
<artifactId>jogl</artifactId>
<version>1.1.1-a</version>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
<version>2.0-rc11</version>
</dependency>
<dependency>
<groupId>com.sun.gluegen.runtime</groupId>
<artifactId>gluegen-rt</artifactId>
<version>1.1.1-a</version>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
<version>2.0-rc11</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
......
......@@ -52,18 +52,17 @@ import org.gephi.visualization.apiimpl.GraphIO;
import org.gephi.visualization.apiimpl.Scheduler;
import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.apiimpl.VizEventManager;
import org.gephi.visualization.bridge.DHNSDataBridge;
import org.gephi.visualization.bridge.DataBridge;
import org.gephi.visualization.config.VizCommander;
import org.gephi.visualization.events.StandardVizEventManager;
import org.gephi.visualization.model.ModelClassLibrary;
import org.gephi.visualization.opengl.AbstractEngine;
import org.gephi.visualization.opengl.CompatibilityEngine;
import org.gephi.visualization.opengl.text.TextManager;
import org.gephi.visualization.scheduler.CompatibilityScheduler;
import org.gephi.visualization.screenshot.ScreenshotMaker;
import org.gephi.visualization.swing.GraphDrawableImpl;
import org.gephi.visualization.swing.StandardGraphIO;
import org.gephi.visualization.text.TextManager;
import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;
......@@ -113,7 +112,7 @@ public class VizController implements VisualizationController {
scheduler = new CompatibilityScheduler();
modelClassLibrary = new ModelClassLibrary();
limits = new GraphLimits();
dataBridge = new DHNSDataBridge();
dataBridge = new DataBridge();
textManager = new TextManager();
screenshotMaker = new ScreenshotMaker();
currentModel = new VizModel(true);
......@@ -144,7 +143,6 @@ public class VizController implements VisualizationController {
@Override
public void select(Workspace workspace) {
engine.reinit();
dataBridge.resetGraph();
}
@Override
......
......@@ -55,7 +55,7 @@ import org.gephi.project.api.Workspace;
import org.gephi.ui.utils.ColorUtils;
import org.gephi.visualization.apiimpl.GraphDrawable;
import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.opengl.text.TextModelImpl;
import org.gephi.visualization.text.TextModelImpl;
/**
*
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.api.initializer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import org.gephi.visualization.VizController;
......@@ -66,13 +66,13 @@ public abstract class Modeler {
this.config = VizController.getInstance().getVizConfig();
}
public abstract int initDisplayLists(GL gl, GLU glu, GLUquadric quadric, int ptr);
public abstract int initDisplayLists(GL2 gl, GLU glu, GLUquadric quadric, int ptr);
public abstract void chooseModel(Model obj);
public abstract void beforeDisplay(GL gl, GLU glu);
public abstract void beforeDisplay(GL2 gl, GLU glu);
public abstract void afterDisplay(GL gl, GLU glu);
public abstract void afterDisplay(GL2 gl, GLU glu);
protected float cameraDistance(NodeModel object) {
float[] cameraLocation = controller.getDrawable().getCameraLocation();
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.api.selection;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.lib.gleem.linalg.Vecf;
import org.gephi.visualization.model.node.NodeModel;
......@@ -58,7 +58,7 @@ public interface SelectionArea {
public boolean mouseTest(Vecf distanceFromMouse, NodeModel nodeModel);
public void drawArea(GL gl, GLU glu);
public void drawArea(GL2 gl, GLU glu);
public boolean isEnabled();
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.apiimpl;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
/**
......@@ -60,7 +60,7 @@ public interface Scheduler {
public void updateWorld();
public void display(GL gl, GLU glu);
public void display(GL2 gl, GLU glu);
public void requireUpdateVisible();
......
......@@ -136,7 +136,7 @@ public class VizConfig {
public static final Color DEFAULT_RECTANGLE_SELECTION_COLOR = new Color(0.16f, 0.48f, 0.81f, 0.2f);
public static final boolean DEFAULT_DRAGGING = true;
public static final boolean DEFAULT_CAMERA_CONTROL = true;
public static final boolean DEFAULT_SHOW_FPS = false;
public static final boolean DEFAULT_SHOW_FPS = true;
public static final boolean DEFAULT_REDUCE_FPS_MOUSE_OUT = true;
public static final boolean DEFAULT_PAUSE_LOOP_MOUSE_OUT = false;
public static final int DEFAULT_REDUCE_FPS_MOUSE_OUT_VALUE = 20;
......
......@@ -45,7 +45,6 @@ import org.gephi.graph.api.Graph;
import org.gephi.graph.api.GraphController;
import org.gephi.graph.api.GraphModel;
import org.gephi.visualization.GraphLimits;
import org.gephi.visualization.VizArchitecture;
import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.opengl.AbstractEngine;
......@@ -53,7 +52,7 @@ import org.gephi.visualization.opengl.AbstractEngine;
*
* @author Mathieu Bastian
*/
public class DHNSDataBridge implements DataBridge, VizArchitecture {
public class DHNSDataBridge {
//Architecture
protected AbstractEngine engine;
......@@ -374,29 +373,4 @@ public class DHNSDataBridge implements DataBridge, VizArchitecture {
// }
// }
// }
@Override
public void updateWorld() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void initArchitecture() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean requireUpdate() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void reset() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void resetGraph() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.bridge;
import org.gephi.graph.api.Graph;
import org.gephi.graph.api.GraphController;
import org.gephi.graph.api.GraphDiff;
import org.gephi.graph.api.GraphModel;
import org.gephi.graph.api.GraphObserver;
import org.gephi.graph.api.Node;
import org.gephi.visualization.GraphLimits;
import org.gephi.visualization.VizArchitecture;
import org.gephi.visualization.VizController;
import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.opengl.AbstractEngine;
import org.openide.util.Lookup;
/**
*
* @author Mathieu Bastian
*/
public interface DataBridge {
public void updateWorld();
public class DataBridge implements VizArchitecture {
public void initArchitecture();
protected AbstractEngine engine;
protected GraphController controller;
private VizConfig vizConfig;
protected GraphLimits limits;
//Graph
protected GraphModel graphModel;
protected Graph graph;
protected GraphObserver observer;
public boolean requireUpdate();
@Override
public void initArchitecture() {
this.engine = VizController.getInstance().getEngine();
this.controller = Lookup.getDefault().lookup(GraphController.class);
this.vizConfig = VizController.getInstance().getVizConfig();
this.limits = VizController.getInstance().getLimits();
}
public void reset();
public synchronized boolean updateWorld() {
if (observer != null && observer.hasGraphChanged()) {
GraphDiff diff = observer.getDiff();
for (Node node : diff.getAddedNodes()) {
}
return true;
}
return false;
}
public void resetGraph();
public synchronized void reset() {
graphModel = controller.getGraphModel();
if (graphModel != null) {
graph = graphModel.getGraphVisible();
}
if (observer != null && observer.getGraph() != graph) {
observer.destroy();
}
if (graphModel != null) {
observer = graphModel.getGraphObserver(graph, true);
}
}
}
......@@ -43,8 +43,6 @@ package org.gephi.visualization.component;
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.AWTEventListener;
import java.awt.event.KeyEvent;
import javax.swing.JComponent;
......@@ -57,7 +55,6 @@ import org.gephi.project.api.WorkspaceListener;
import org.gephi.tools.api.ToolController;
import org.gephi.ui.utils.UIUtils;
import org.gephi.visualization.VizController;
import org.gephi.visualization.apiimpl.PropertiesBarAddon;
import org.gephi.visualization.opengl.AbstractEngine;
import org.gephi.visualization.swing.GraphDrawableImpl;
import org.netbeans.api.settings.ConvertAsProperties;
......@@ -96,7 +93,7 @@ public class GraphTopComponent extends TopComponent implements AWTEventListener
initToolPanels();
final GraphDrawableImpl drawable = VizController.getInstance().getDrawable();
//Request component activation and therefore initialize JOGL component
//Request component activation and therefore initialize JOGL2 component
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {
......@@ -128,7 +125,6 @@ public class GraphTopComponent extends TopComponent implements AWTEventListener
private ActionsToolbar actionsToolbar;
private JComponent toolbar;
private JComponent propertiesBar;
private AddonsBar addonsBar;
private void initToolPanels() {
final ToolController tc = Lookup.getDefault().lookup(ToolController.class);
......@@ -152,20 +148,10 @@ public class GraphTopComponent extends TopComponent implements AWTEventListener
}
if (VizController.getInstance().getVizConfig().isPropertiesbar()) {
JPanel northBar = new JPanel(new BorderLayout());
if (UIUtils.isAquaLookAndFeel()) {
northBar.setBackground(UIManager.getColor("NbExplorerView.background"));
}
propertiesBar = tc.getPropertiesBar();
if (propertiesBar != null) {
northBar.add(propertiesBar, BorderLayout.CENTER);
add(propertiesBar, BorderLayout.NORTH);
}
addonsBar = new AddonsBar();
for (PropertiesBarAddon addon : Lookup.getDefault().lookupAll(PropertiesBarAddon.class)) {
addonsBar.add(addon.getComponent());
}
northBar.add(addonsBar, BorderLayout.EAST);
add(northBar, BorderLayout.NORTH);
}
}
......@@ -178,11 +164,18 @@ public class GraphTopComponent extends TopComponent implements AWTEventListener
@Override
public void select(Workspace workspace) {
toolbar.setEnabled(true);
propertiesBar.setEnabled(true);
actionsToolbar.setEnabled(true);
selectionToolbar.setEnabled(true);
addonsBar.setEnabled(true);
if (toolbar != null) {
toolbar.setEnabled(true);
}
if (propertiesBar != null) {
propertiesBar.setEnabled(true);
}
if (actionsToolbar != null) {
actionsToolbar.setEnabled(true);
}
if (selectionToolbar != null) {
selectionToolbar.setEnabled(true);
}
}
@Override
......@@ -195,21 +188,37 @@ public class GraphTopComponent extends TopComponent implements AWTEventListener
@Override
public void disable() {
toolbar.setEnabled(false);
tc.select(null);//Unselect any selected tool
propertiesBar.setEnabled(false);
actionsToolbar.setEnabled(false);
selectionToolbar.setEnabled(false);
addonsBar.setEnabled(false);
if (toolbar != null) {
toolbar.setEnabled(false);
}
if (tc != null) {
tc.select(null);//Unselect any selected tool
}
if (propertiesBar != null) {
propertiesBar.setEnabled(false);
}
if (actionsToolbar != null) {
actionsToolbar.setEnabled(false);
}
if (selectionToolbar != null) {
selectionToolbar.setEnabled(false);
}
}
});
boolean hasWorkspace = projectController.getCurrentWorkspace() != null;
toolbar.setEnabled(hasWorkspace);
propertiesBar.setEnabled(hasWorkspace);
actionsToolbar.setEnabled(hasWorkspace);
selectionToolbar.setEnabled(hasWorkspace);
addonsBar.setEnabled(hasWorkspace);
if (toolbar != null) {
toolbar.setEnabled(hasWorkspace);
}
if (propertiesBar != null) {
propertiesBar.setEnabled(hasWorkspace);
}
if (actionsToolbar != null) {
actionsToolbar.setEnabled(hasWorkspace);
}
if (selectionToolbar != null) {
selectionToolbar.setEnabled(hasWorkspace);
}
}
private void initKeyEventContextMenuActionMappings() {
......@@ -319,23 +328,4 @@ public class GraphTopComponent extends TopComponent implements AWTEventListener
String version = p.getProperty("version");
// TODO read your settings according to their version
}
private static class AddonsBar extends JPanel {
public AddonsBar() {
super(new FlowLayout(FlowLayout.RIGHT, 0, 0));
}
@Override
public void setEnabled(final boolean enabled) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for (Component c : getComponents()) {
c.setEnabled(enabled);
}
}
});
}
}
}
......@@ -54,7 +54,7 @@ import net.miginfocom.swing.MigLayout;
import org.gephi.attribute.api.Column;
import org.gephi.attribute.api.Origin;
import org.gephi.graph.api.GraphController;
import org.gephi.visualization.opengl.text.TextModelImpl;
import org.gephi.visualization.text.TextModelImpl;
import org.openide.util.Lookup;
/**
......
......@@ -56,10 +56,10 @@ import javax.swing.event.ChangeListener;
import org.gephi.ui.components.JColorButton;
import org.gephi.visualization.VizController;
import org.gephi.visualization.VizModel;
import org.gephi.visualization.opengl.text.ColorMode;
import org.gephi.visualization.opengl.text.SizeMode;
import org.gephi.visualization.opengl.text.TextManager;
import org.gephi.visualization.opengl.text.TextModelImpl;
import org.gephi.visualization.text.ColorMode;
import org.gephi.visualization.text.SizeMode;
import org.gephi.visualization.text.TextManager;
import org.gephi.visualization.text.TextModelImpl;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
......
......@@ -64,10 +64,10 @@ import org.gephi.ui.components.JDropDownButton;
import org.gephi.ui.components.JPopupButton;
import org.gephi.visualization.VizController;
import org.gephi.visualization.VizModel;
import org.gephi.visualization.opengl.text.ColorMode;
import org.gephi.visualization.opengl.text.SizeMode;
import org.gephi.visualization.opengl.text.TextManager;
import org.gephi.visualization.opengl.text.TextModelImpl;
import org.gephi.visualization.text.ColorMode;
import org.gephi.visualization.text.SizeMode;
import org.gephi.visualization.text.TextManager;
import org.gephi.visualization.text.TextModelImpl;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
......
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.config;
import javax.media.opengl.GL;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.opengl.GL2;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLProfile;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
/**
* Class dedicated to the analysis and tuning of the engine for the detected configuration
* (graphic card, cpu...)
* Class dedicated to the analysis and tuning of the engine for the detected
* configuration (graphic card, cpu...)
*
* @author Mathieu Bastian
*/
......@@ -62,17 +65,20 @@ public class GraphicalConfiguration {
private String vendor = "";
private String renderer = "";
private String versionStr = "";
private GLProfile profile = GLProfile.get(GLProfile.GL2);
private GLCapabilities caps = new GLCapabilities(profile);
AbstractGraphicsDevice device = GLDrawableFactory.getFactory(profile).getDefaultDevice();
public void checkGeneralCompatibility(GL gl) {
public void checkGeneralCompatibility(GL2 gl) {
if (messageDelivered) {
return;
}
try {
//Vendor
vendor = gl.glGetString(GL.GL_VENDOR);
renderer = gl.glGetString(GL.GL_RENDERER);
versionStr = gl.glGetString(GL.GL_VERSION);
vendor = gl.glGetString(GL2.GL_VENDOR);
renderer = gl.glGetString(GL2.GL_RENDERER);
versionStr = gl.glGetString(GL2.GL_VERSION);
String currentConfig = String.format(NbBundle.getMessage(GraphicalConfiguration.class, "graphicalConfiguration_currentConfig"), vendor, renderer, versionStr);
// Check version.
......@@ -81,21 +87,22 @@ public class GraphicalConfiguration {
throw new GraphicalConfigurationException(err);
}
//VBO
boolean vboExtension = gl.isExtensionAvailable("GL_ARB_vertex_buffer_object");
boolean vboFunctions = gl.isFunctionAvailable("glGenBuffersARB") &&
gl.isFunctionAvailable("glBindBufferARB") &&
gl.isFunctionAvailable("glBufferDataARB") &&
gl.isFunctionAvailable("glDeleteBuffersARB");
boolean vboFunctions = gl.isFunctionAvailable("glGenBuffersARB")
&& gl.isFunctionAvailable("glBindBufferARB")
&& gl.isFunctionAvailable("glBufferDataARB")
&& gl.isFunctionAvailable("glDeleteBuffersARB");
vboSupport = vboExtension && vboFunctions;
//Pbuffer
pBufferSupport = GLDrawableFactory.getFactory().canCreateGLPbuffer();
pBufferSupport = GLDrawableFactory.getDesktopFactory().canCreateGLPbuffer(device);
} catch (final GraphicalConfigurationException exc) {
messageDelivered = true;
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), exc.getMessage(), "Configuration", JOptionPane.WARNING_MESSAGE);
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.gephi.visualization.model;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.visualization.VizModel;
......@@ -14,5 +10,5 @@ import org.gephi.visualization.VizModel;
*/
public interface Model {
public void display(GL gl, GLU glu, VizModel model);
public void display(GL2 gl, GLU glu, VizModel model);
}
......@@ -44,7 +44,7 @@ package org.gephi.visualization.model;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.visualization.VizController;
import org.gephi.visualization.api.initializer.Modeler;
......@@ -87,11 +87,11 @@ public class ModelClass {
}
}
public void beforeDisplay(GL gl, GLU glu) {
public void beforeDisplay(GL2 gl, GLU glu) {
currentModeler.beforeDisplay(gl, glu);
}
public void afterDisplay(GL gl, GLU glu) {
public void afterDisplay(GL2 gl, GLU glu) {
currentModeler.afterDisplay(gl, glu);
}
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Edge;
import org.gephi.graph.api.Node;
......@@ -64,7 +64,7 @@ public class Arrow2dModel extends ArrowModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
if (!edgeModel.isSelected() && vizModel.isHideNonSelectedEdges()) {
return;
}
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Edge;
import org.gephi.graph.api.Node;
......@@ -62,7 +62,7 @@ public class Arrow3dModel extends Arrow2dModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
float[] cameraLocation = VizController.getInstance().getDrawable().getCameraLocation();
if (!edgeModel.isSelected() && vizModel.isHideNonSelectedEdges()) {
return;
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import org.gephi.visualization.api.initializer.Modeler;
......@@ -83,17 +83,17 @@ public class ArrowModeler extends Modeler {
}
@Override
public void beforeDisplay(GL gl, GLU glu) {
gl.glBegin(GL.GL_TRIANGLES);
public void beforeDisplay(GL2 gl, GLU glu) {
gl.glBegin(GL2.GL_TRIANGLES);
}
@Override
public void afterDisplay(GL gl, GLU glu) {
public void afterDisplay(GL2 gl, GLU glu) {
gl.glEnd();
}
@Override
public int initDisplayLists(GL gl, GLU glu, GLUquadric quadric, int ptr) {
public int initDisplayLists(GL2 gl, GLU glu, GLUquadric quadric, int ptr) {
return ptr;
}
}
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Edge;
import org.gephi.graph.api.Node;
......@@ -71,7 +71,7 @@ public class Edge2dModel extends EdgeModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
if (!selected && vizModel.isHideNonSelectedEdges()) {
return;
}
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Edge;
import org.gephi.graph.api.Node;
......@@ -61,7 +61,7 @@ public class Edge3dModel extends Edge2dModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
float[] cameraLocation = VizController.getInstance().getDrawable().getCameraLocation();
if (!selected && vizModel.isHideNonSelectedEdges()) {
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import org.gephi.graph.api.Edge;
......@@ -81,12 +81,12 @@ public class EdgeModeler extends Modeler {
}
@Override
public void beforeDisplay(GL gl, GLU glu) {
gl.glBegin(GL.GL_TRIANGLES);
public void beforeDisplay(GL2 gl, GLU glu) {
gl.glBegin(GL2.GL_TRIANGLES);
}
@Override
public void afterDisplay(GL gl, GLU glu) {
public void afterDisplay(GL2 gl, GLU glu) {
gl.glEnd();
}
......@@ -96,7 +96,7 @@ public class EdgeModeler extends Modeler {
}
@Override
public int initDisplayLists(GL gl, GLU glu, GLUquadric quadric, int ptr) {
public int initDisplayLists(GL2 gl, GLU glu, GLUquadric quadric, int ptr) {
return ptr;
}
}
......@@ -41,9 +41,9 @@
*/
package org.gephi.visualization.model.edge;
import com.sun.opengl.util.BufferUtil;
import com.jogamp.common.nio.Buffers;
import java.nio.FloatBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Edge;
import org.gephi.graph.api.Node;
......@@ -60,7 +60,7 @@ public class SelfLoop2dModel extends EdgeModel {
private static Vec3f upVector = new Vec3f(0f, 1f, 0f);
private static Vec3f sideVector = new Vec3f(1f, 0f, 0f);
protected static FloatBuffer buffer = BufferUtil.newFloatBuffer(24);
protected static FloatBuffer buffer = Buffers.newDirectFloatBuffer(24);
protected static int segments = 20;
//
protected final NodeModel nodeModel;
......@@ -71,7 +71,7 @@ public class SelfLoop2dModel extends EdgeModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
gl.glEnd();
......@@ -215,15 +215,15 @@ public class SelfLoop2dModel extends EdgeModel {
}
//Display
gl.glMap2f(GL.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 2, buffer); //Map evaluators
gl.glEnable(GL.GL_MAP2_VERTEX_3);
gl.glMap2f(GL2.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 2, buffer); //Map evaluators
gl.glEnable(GL2.GL_MAP2_VERTEX_3);
gl.glMapGrid2f(segments, 0, 1, 1, 0, 1); //Grid
gl.glEvalMesh2(GL.GL_FILL, 0, segments, 0, 1); //Display
gl.glDisable(GL.GL_MAP2_VERTEX_3);
gl.glEvalMesh2(GL2.GL_FILL, 0, segments, 0, 1); //Display
gl.glDisable(GL2.GL_MAP2_VERTEX_3);
gl.glEnd();
gl.glBegin(GL.GL_TRIANGLES);
gl.glBegin(GL2.GL_TRIANGLES);
}
@Override
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Edge;
import org.gephi.graph.api.Node;
......@@ -64,7 +64,7 @@ public class SelfLoop3dModel extends SelfLoop2dModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
float[] cameraLocation = VizController.getInstance().getDrawable().getCameraLocation();
gl.glEnd();
......@@ -219,15 +219,15 @@ public class SelfLoop3dModel extends SelfLoop2dModel {
}
//Display
gl.glMap2f(GL.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 2, buffer); //Map evaluators
gl.glEnable(GL.GL_MAP2_VERTEX_3);
gl.glMap2f(GL2.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 2, buffer); //Map evaluators
gl.glEnable(GL2.GL_MAP2_VERTEX_3);
gl.glMapGrid2f(segments, 0, 1, 1, 0, 1); //Grid
gl.glEvalMesh2(GL.GL_FILL, 0, segments, 0, 1); //Display
gl.glDisable(GL.GL_MAP2_VERTEX_3);
gl.glEvalMesh2(GL2.GL_FILL, 0, segments, 0, 1); //Display
gl.glDisable(GL2.GL_MAP2_VERTEX_3);
gl.glEnd();
gl.glBegin(GL.GL_TRIANGLES);
gl.glBegin(GL2.GL_TRIANGLES);
}
}
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.node;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Node;
import org.gephi.lib.gleem.linalg.Vecf;
......@@ -61,7 +61,7 @@ public class NodeDiskModel extends NodeModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
boolean selec = selected;
boolean neighbor = false;
highlight = false;
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.node;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import org.gephi.graph.api.Node;
......@@ -99,49 +99,49 @@ public class NodeDiskModeler extends NodeModeler {
}
@Override
public int initDisplayLists(GL gl, GLU glu, GLUquadric quadric, int ptr) {
public int initDisplayLists(GL2 gl, GLU glu, GLUquadric quadric, int ptr) {
// Diamond display list
SHAPE_DIAMOND = ptr + 1;
gl.glNewList(SHAPE_DIAMOND, GL.GL_COMPILE);
gl.glNewList(SHAPE_DIAMOND, GL2.GL_COMPILE);
glu.gluDisk(quadric, 0, 0.5, 4, 1);
gl.glEndList();
//End
//Disk16
SHAPE_DISK16 = SHAPE_DIAMOND + 1;
gl.glNewList(SHAPE_DISK16, GL.GL_COMPILE);
gl.glNewList(SHAPE_DISK16, GL2.GL_COMPILE);
glu.gluDisk(quadric, 0, 0.5, 6, 1);
gl.glEndList();
//Fin
//Disk32
SHAPE_DISK32 = SHAPE_DISK16 + 1;
gl.glNewList(SHAPE_DISK32, GL.GL_COMPILE);
gl.glNewList(SHAPE_DISK32, GL2.GL_COMPILE);
glu.gluDisk(quadric, 0, 0.5, 12, 2);
gl.glEndList();
//Disk64
SHAPE_DISK64 = SHAPE_DISK32 + 1;
gl.glNewList(SHAPE_DISK64, GL.GL_COMPILE);
gl.glNewList(SHAPE_DISK64, GL2.GL_COMPILE);
glu.gluDisk(quadric, 0, 0.5, 32, 4);
gl.glEndList();
//Border16
BORDER16 = SHAPE_DISK64 + 1;
gl.glNewList(BORDER16, GL.GL_COMPILE);
gl.glNewList(BORDER16, GL2.GL_COMPILE);
glu.gluDisk(quadric, 0.42, 0.50, 24, 2);
gl.glEndList();
//Border32
BORDER32 = BORDER16 + 1;
gl.glNewList(BORDER32, GL.GL_COMPILE);
gl.glNewList(BORDER32, GL2.GL_COMPILE);
glu.gluDisk(quadric, 0.42, 0.50, 48, 2);
gl.glEndList();
//Border32
BORDER64 = BORDER32 + 1;
gl.glNewList(BORDER64, GL.GL_COMPILE);
gl.glNewList(BORDER64, GL2.GL_COMPILE);
glu.gluDisk(quadric, 0.42, 0.50, 96, 4);
gl.glEndList();
......@@ -149,11 +149,11 @@ public class NodeDiskModeler extends NodeModeler {
}
@Override
public void beforeDisplay(GL gl, GLU glu) {
public void beforeDisplay(GL2 gl, GLU glu) {
}
@Override
public void afterDisplay(GL gl, GLU glu) {
public void afterDisplay(GL2 gl, GLU glu) {
}
@Override
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.node;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Node;
import org.gephi.lib.gleem.linalg.Vecf;
......@@ -64,7 +64,7 @@ public class NodeRectangeModel extends NodeModel {
}
@Override
public void display(GL gl, GLU glu, VizModel vizModel) {
public void display(GL2 gl, GLU glu, VizModel vizModel) {
boolean selec = selected;
boolean neighbor = false;
highlight = false;
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.node;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import org.gephi.graph.api.Node;
......@@ -83,17 +83,17 @@ public class NodeRectangleModeler extends NodeModeler {
}
@Override
public int initDisplayLists(GL gl, GLU glu, GLUquadric quadric, int ptr) {
public int initDisplayLists(GL2 gl, GLU glu, GLUquadric quadric, int ptr) {
return ptr;
}
@Override
public void beforeDisplay(GL gl, GLU glu) {
gl.glBegin(GL.GL_QUADS);
public void beforeDisplay(GL2 gl, GLU glu) {
gl.glBegin(GL2.GL_QUADS);
}
@Override
public void afterDisplay(GL gl, GLU glu) {
public void afterDisplay(GL2 gl, GLU glu) {
gl.glEnd();
}
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.node;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Node;
import org.gephi.lib.gleem.linalg.Vecf;
......@@ -64,7 +64,7 @@ public class NodeSphereModel extends NodeModel {
}
@Override
public void display(GL gl, GLU glu, VizModel model) {
public void display(GL2 gl, GLU glu, VizModel model) {
boolean selec = selected;
boolean neighbor = false;
highlight = false;
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.model.node;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import org.gephi.graph.api.Node;
......@@ -96,17 +96,17 @@ public class NodeSphereModeler extends NodeModeler {
}
@Override
public int initDisplayLists(GL gl, GLU glu, GLUquadric quadric, int ptr) {
public int initDisplayLists(GL2 gl, GLU glu, GLUquadric quadric, int ptr) {
// Diamond display list
SHAPE_DIAMOND = ptr + 1;
gl.glNewList(SHAPE_DIAMOND, GL.GL_COMPILE);
gl.glNewList(SHAPE_DIAMOND, GL2.GL_COMPILE);
glu.gluSphere(quadric, 0.5f, 4, 2);
gl.glEndList();
//End
// Sphere16 display list
SHAPE_SPHERE16 = SHAPE_DIAMOND + 1;
gl.glNewList(SHAPE_SPHERE16, GL.GL_COMPILE);
gl.glNewList(SHAPE_SPHERE16, GL2.GL_COMPILE);
gl.glCallList(ptr);
glu.gluSphere(quadric, 0.5f, 16, 8);
gl.glEndList();
......@@ -115,14 +115,14 @@ public class NodeSphereModeler extends NodeModeler {
// Sphere32 display list
SHAPE_SPHERE32 = SHAPE_SPHERE16 + 1;
gl.glNewList(SHAPE_SPHERE32, GL.GL_COMPILE);
gl.glNewList(SHAPE_SPHERE32, GL2.GL_COMPILE);
gl.glCallList(ptr);
glu.gluSphere(quadric, 0.5f, 32, 16);
gl.glEndList();
// Sphere32 display list
SHAPE_SPHERE64 = SHAPE_SPHERE32 + 1;
gl.glNewList(SHAPE_SPHERE64, GL.GL_COMPILE);
gl.glNewList(SHAPE_SPHERE64, GL2.GL_COMPILE);
gl.glCallList(ptr);
glu.gluSphere(quadric, 0.5f, 64, 32);
gl.glEndList();
......@@ -131,11 +131,11 @@ public class NodeSphereModeler extends NodeModeler {
}
@Override
public void beforeDisplay(GL gl, GLU glu) {
public void beforeDisplay(GL2 gl, GLU glu) {
}
@Override
public void afterDisplay(GL gl, GLU glu) {
public void afterDisplay(GL2 gl, GLU glu) {
}
@Override
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.gephi.visualization.octree;
import com.sun.opengl.util.GLUT;
import javax.media.opengl.GL;
import com.jogamp.opengl.util.gl2.GLUT;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.visualization.model.node.NodeModel;
......@@ -97,10 +93,10 @@ public class Octant {
return size;
}
protected void displayOctant(GL gl) {
protected void displayOctant(GL2 gl) {
float quantum = size / 2;
gl.glBegin(GL.GL_QUAD_STRIP);
gl.glBegin(GL2.GL_QUAD_STRIP);
gl.glVertex3f(posX + quantum, posY + quantum, posZ + quantum);
gl.glVertex3f(posX + quantum, posY - quantum, posZ + quantum);
gl.glVertex3f(posX + quantum, posY + quantum, posZ - quantum);
......@@ -112,7 +108,7 @@ public class Octant {
gl.glVertex3f(posX + quantum, posY + quantum, posZ + quantum);
gl.glVertex3f(posX + quantum, posY - quantum, posZ + quantum);
gl.glEnd();
gl.glBegin(GL.GL_QUADS);
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(posX - quantum, posY + quantum, posZ - quantum);
gl.glVertex3f(posX - quantum, posY + quantum, posZ + quantum);
gl.glVertex3f(posX + quantum, posY + quantum, posZ + quantum);
......@@ -125,7 +121,7 @@ public class Octant {
gl.glEnd();
}
protected void displayOctantInfo(GL gl, GLU glu) {
protected void displayOctantInfo(GL2 gl, GLU glu) {
GLUT glut = new GLUT();
float quantum = size / 2;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.gephi.visualization.octree;
import com.sun.opengl.util.BufferUtil;
import com.jogamp.common.nio.Buffers;
import it.unimi.dsi.fastutil.ints.IntRBTreeSet;
import it.unimi.dsi.fastutil.ints.IntSortedSet;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.graph.api.Node;
import org.gephi.lib.gleem.linalg.Vec3f;
......@@ -265,18 +261,18 @@ public class Octree {
limits.setMaxYviewport(viewportMaxY);
}
public void updateVisibleOctant(GL gl) {
public void updateVisibleOctant(GL2 gl) {
//Limits
refreshLimits();
//Switch to OpenGL select mode
//Switch to OpenGL2 select mode
int capacity = 1 * 4 * leaves.length; //Each object take in maximium : 4 * name stack depth
IntBuffer hitsBuffer = BufferUtil.newIntBuffer(capacity);
IntBuffer hitsBuffer = Buffers.newDirectIntBuffer(capacity);
gl.glSelectBuffer(hitsBuffer.capacity(), hitsBuffer);
gl.glRenderMode(GL.GL_SELECT);
gl.glRenderMode(GL2.GL_SELECT);
gl.glInitNames();
gl.glPushName(0);
gl.glDisable(GL.GL_CULL_FACE); //Disable flags
gl.glDisable(GL2.GL_CULL_FACE); //Disable flags
//Draw the nodes cube in the select buffer
for (Octant n : leaves) {
gl.glLoadName(n.leafId);
......@@ -284,10 +280,10 @@ public class Octree {
n.visible = false;
}
visibleLeaves = 0;
int nbRecords = gl.glRenderMode(GL.GL_RENDER);
int nbRecords = gl.glRenderMode(GL2.GL_RENDER);
if (vizController.getVizModel().isCulling()) {
gl.glEnable(GL.GL_CULL_FACE);
gl.glCullFace(GL.GL_BACK);
gl.glEnable(GL2.GL_CULL_FACE);
gl.glCullFace(GL2.GL_BACK);
}
//Get the hits and add the nodes' objects to the array
......@@ -312,26 +308,26 @@ public class Octree {
}
}
public void updateSelectedOctant(GL gl, GLU glu, float[] mousePosition, float[] pickRectangle) {
public void updateSelectedOctant(GL2 gl, GLU glu, float[] mousePosition, float[] pickRectangle) {
//Start Picking mode
int capacity = 1 * 4 * visibleLeaves; //Each object take in maximium : 4 * name stack depth
IntBuffer hitsBuffer = BufferUtil.newIntBuffer(capacity);
IntBuffer hitsBuffer = Buffers.newDirectIntBuffer(capacity);
gl.glSelectBuffer(hitsBuffer.capacity(), hitsBuffer);
gl.glRenderMode(GL.GL_SELECT);
gl.glDisable(GL.GL_CULL_FACE); //Disable flags
gl.glRenderMode(GL2.GL_SELECT);
gl.glDisable(GL2.GL_CULL_FACE); //Disable flags
gl.glInitNames();
gl.glPushName(0);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
glu.gluPickMatrix(mousePosition[0], mousePosition[1], pickRectangle[0], pickRectangle[1], drawable.getViewport());
gl.glMultMatrixd(drawable.getProjectionMatrix());
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
//Draw the nodes' cube int the select buffer
int hitName = 1;
......@@ -345,16 +341,16 @@ public class Octree {
}
//Restoring the original projection matrix
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPopMatrix();
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glFlush();
//Returning to normal rendering mode
int nbRecords = gl.glRenderMode(GL.GL_RENDER);
int nbRecords = gl.glRenderMode(GL2.GL_RENDER);
if (vizController.getVizModel().isCulling()) {
gl.glEnable(GL.GL_CULL_FACE);
gl.glCullFace(GL.GL_BACK);
gl.glEnable(GL2.GL_CULL_FACE);
gl.glCullFace(GL2.GL_BACK);
}
//Clean previous selection
......
......@@ -43,7 +43,7 @@ package org.gephi.visualization.opengl;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.lib.gleem.linalg.Vecf;
import org.gephi.visualization.VizArchitecture;
......@@ -59,8 +59,8 @@ import org.gephi.visualization.model.ModelClass;
import org.gephi.visualization.model.ModelClassLibrary;
import org.gephi.visualization.model.node.NodeModel;
import org.gephi.visualization.octree.Octree;
import org.gephi.visualization.opengl.text.TextManager;
import org.gephi.visualization.swing.GraphDrawableImpl;
import org.gephi.visualization.text.TextManager;
/**
* Abstract graphic engine. Real graphic engines inherit from this class and can
......@@ -129,17 +129,17 @@ public abstract class AbstractEngine implements Engine, VizArchitecture {
});
}
public abstract void beforeDisplay(GL gl, GLU glu);
public abstract void beforeDisplay(GL2 gl, GLU glu);
public abstract void display(GL gl, GLU glu);
public abstract void display(GL2 gl, GLU glu);
public abstract void afterDisplay(GL gl, GLU glu);
public abstract void afterDisplay(GL2 gl, GLU glu);
public abstract void initEngine(GL gl, GLU glu);
public abstract void initEngine(GL2 gl, GLU glu);
public abstract void initScreenshot(GL gl, GLU glu);
public abstract void initScreenshot(GL2 gl, GLU glu);
public abstract void cameraHasBeenMoved(GL gl, GLU glu);
public abstract void cameraHasBeenMoved(GL2 gl, GLU glu);
public abstract void mouseMove();
......@@ -237,6 +237,10 @@ public abstract class AbstractEngine implements Engine, VizArchitecture {
return octree;
}
public ModelClass getNodeClass() {
return nodeClass;
}
protected class EngineLifeCycle {
private boolean inited;
......
......@@ -45,7 +45,7 @@ import java.awt.Color;
import java.nio.FloatBuffer;
import java.util.Arrays;
import java.util.Iterator;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import org.gephi.visualization.VizController;
......@@ -87,7 +87,7 @@ public class CompatibilityEngine extends AbstractEngine {
octree.initArchitecture();
}
public void updateSelection(GL gl, GLU glu) {
public void updateSelection(GL2 gl, GLU glu) {
if (vizConfig.isSelectionEnable() && currentSelectionArea != null && currentSelectionArea.isEnabled()) {
float[] mp = Arrays.copyOf(graphIO.getMousePosition(), 2);
float[] cent = currentSelectionArea.getSelectionAreaCenter();
......@@ -101,36 +101,37 @@ public class CompatibilityEngine extends AbstractEngine {
@Override
public boolean updateWorld() {
boolean res = false;
boolean newConfig = configChanged;
if (newConfig) {
dataBridge.reset();
if (!vizConfig.isCustomSelection()) {
//Reset model classes
// for (ModelClass objClass : getModelClasses()) {
// if (objClass.isEnabled()) {
// objClass.swapModelers();
// resetObjectClass(objClass);
// }
// }
}
initSelection();
}
if (dataBridge.requireUpdate() || newConfig) {
dataBridge.updateWorld();
res = true;
}
if (newConfig) {
configChanged = false;
}
return res;
return dataBridge.updateWorld();
// boolean res = false;
// boolean newConfig = configChanged;
// if (newConfig) {
// dataBridge.reset();
// if (!vizConfig.isCustomSelection()) {
// //Reset model classes
//// for (ModelClass objClass : getModelClasses()) {
//// if (objClass.isEnabled()) {
//// objClass.swapModelers();
//// resetObjectClass(objClass);
//// }
//// }
// }
//
// initSelection();
//
// }
// if (dataBridge.requireUpdate() || newConfig) {
// dataBridge.updateWorld();
// res = true;
// }
// if (newConfig) {
//
// configChanged = false;
// }
// return res;
}
@Override
public void beforeDisplay(GL gl, GLU glu) {
public void beforeDisplay(GL2 gl, GLU glu) {
//Lighten delta
if (lightenAnimationDelta != 0) {
float factor = vizConfig.getLightenNonSelectedFactor();
......@@ -146,7 +147,7 @@ public class CompatibilityEngine extends AbstractEngine {
if (backgroundChanged) {
Color backgroundColor = vizController.getVizModel().getBackgroundColor();
gl.glClearColor(backgroundColor.getRed() / 255f, backgroundColor.getGreen() / 255f, backgroundColor.getBlue() / 255f, 1f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
backgroundChanged = false;
}
......@@ -162,7 +163,7 @@ public class CompatibilityEngine extends AbstractEngine {
}
@Override
public void display(GL gl, GLU glu) {
public void display(GL2 gl, GLU glu) {
// for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_NODE); itr.hasNext();) { //TODO Move this
// ModelImpl obj = itr.next();
// modelClasses[AbstractEngine.CLASS_NODE].getCurrentModeler().chooseModel(obj);
......@@ -278,30 +279,30 @@ public class CompatibilityEngine extends AbstractEngine {
}
@Override
public void afterDisplay(GL gl, GLU glu) {
public void afterDisplay(GL2 gl, GLU glu) {
if (vizConfig.isSelectionEnable() && currentSelectionArea != null) {
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glOrtho(0, graphDrawable.getViewportWidth(), 0, graphDrawable.getViewportHeight(), -1, 1);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glPushMatrix();
gl.glLoadIdentity();
currentSelectionArea.drawArea(gl, glu);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPopMatrix();
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glPopMatrix();
}
graphIO.trigger();
}
@Override
public void cameraHasBeenMoved(GL gl, GLU glu) {
public void cameraHasBeenMoved(GL2 gl, GLU glu) {
}
@Override
public void initEngine(final GL gl, final GLU glu) {
public void initEngine(final GL2 gl, final GLU glu) {
initDisplayLists(gl, glu);
// scheduler.cameraMoved.set(true);
// scheduler.mouseMoved.set(true);
......@@ -309,7 +310,7 @@ public class CompatibilityEngine extends AbstractEngine {
}
@Override
public void initScreenshot(GL gl, GLU glu) {
public void initScreenshot(GL2 gl, GLU glu) {
initDisplayLists(gl, glu);
textManager.getNodeRenderer().reinitRenderer();
textManager.getEdgeRenderer().reinitRenderer();
......@@ -633,7 +634,7 @@ public class CompatibilityEngine extends AbstractEngine {
// }
}
private void initDisplayLists(GL gl, GLU glu) {
private void initDisplayLists(GL2 gl, GLU glu) {
//Constants
float blancCasse[] = {(float) 213 / 255, (float) 208 / 255, (float) 188 / 255, 1.0f};
float noirCasse[] = {(float) 39 / 255, (float) 25 / 255, (float) 99 / 255, 1.0f};
......@@ -652,11 +653,11 @@ public class CompatibilityEngine extends AbstractEngine {
// Metal material display list
int MATTER_METAL = ptr;
gl.glNewList(MATTER_METAL, GL.GL_COMPILE);
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, ambient_metal);
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, diffuse_metal);
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, specular_metal);
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, shininess_metal);
gl.glNewList(MATTER_METAL, GL2.GL_COMPILE);
gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_AMBIENT, ambient_metal);
gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE, diffuse_metal);
gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_SPECULAR, specular_metal);
gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_SHININESS, shininess_metal);
gl.glEndList();
//Fin
......@@ -671,9 +672,9 @@ public class CompatibilityEngine extends AbstractEngine {
// Sphere with a texture
//SHAPE_BILLBOARD = SHAPE_SPHERE32 + 1;
/*gl.glNewList(SHAPE_BILLBOARD,GL.GL_COMPILE);
/*gl.glNewList(SHAPE_BILLBOARD,GL2.GL_COMPILE);
textures[0].bind();
gl.glBegin(GL.GL_TRIANGLE_STRIP);
gl.glBegin(GL2.GL_TRIANGLE_STRIP);
// Map the texture and create the vertices for the particle.
gl.glTexCoord2d(1, 1);
gl.glVertex3f(0.5f, 0.5f, 0);
......@@ -685,7 +686,7 @@ public class CompatibilityEngine extends AbstractEngine {
gl.glVertex3f(-0.5f,-0.5f, 0);
gl.glEnd();
gl.glBindTexture(GL.GL_TEXTURE_2D,0);
gl.glBindTexture(GL2.GL_TEXTURE_2D,0);
gl.glEndList();*/
//Fin
......
......@@ -53,7 +53,7 @@ import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
/**
* Manages the JOGL natives loading. Thanks to Michael Bien, Lilian Chamontin
* Manages the JOGL2 natives loading. Thanks to Michael Bien, Lilian Chamontin
* and Kenneth Russell.
*
* @author Mathieu Bastan
......@@ -65,7 +65,7 @@ public class JOGLNativesInstaller extends ModuleInstall {
@Override
public void restored() {
if (System.getProperty("org.gephi.jogl.init", "true").equals("true")) {
if (System.getProperty("org.gephi.joGL2.init", "true").equals("true")) {
if (findCompatibleOsAndArch()) {
String nativeArch = nativeLibInfo.getSubDirectoryPath();
File joglDistFolder = InstalledFileLocator.getDefault().locate("modules/lib/" + nativeArch, "org-gephi-visualization-impl", false);
......@@ -109,12 +109,12 @@ public class JOGLNativesInstaller extends ModuleInstall {
@Override
public void run() {
System.out.println("Loading native libraries");
// disable JOGL and GlueGen runtime library loading from elsewhere
com.sun.opengl.impl.NativeLibLoader.disableLoading();
com.sun.gluegen.runtime.NativeLibLoader.disableLoading();
// disable JOGL2 and GlueGen runtime library loading from elsewhere
// com.sun.openGL2.impl.NativeLibLoader.disableLoading();
// com.sun.gluegen.runtime.NativeLibLoader.disableLoading();
// Open GlueGen runtime library optimistically. Note that
// currently we do not need this on any platform except X11
// ones, because JOGL doesn't use the GlueGen NativeLibrary
// ones, because JOGL2 doesn't use the GlueGen NativeLibrary
// class anywhere except the DRIHack class, but if for
// example we add JOAL support then we will need this on
// every platform.
......@@ -123,13 +123,13 @@ public class JOGLNativesInstaller extends ModuleInstall {
if (nativeLibInfo.mayNeedDRIHack()) {
// Run the DRI hack
try {
driHackClass = Class.forName("com.sun.opengl.impl.x11.DRIHack");
driHackClass = Class.forName("com.sun.openGL2.impl.x11.DRIHack");
driHackClass.getMethod("begin", new Class[]{}).invoke(null, new Object[]{});
} catch (Exception e) {
e.printStackTrace();
}
}
// Load core JOGL native library
// Load core JOGL2 native library
loadLibrary(nativeLibDir, "jogl");
if (nativeLibInfo.mayNeedDRIHack()) {
// End DRI hack
......
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl;
import java.util.ArrayList;
import java.util.List;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import org.gephi.ui.utils.PrefsUtils;
import org.openide.util.NbPreferences;
......@@ -69,7 +69,6 @@ public class Lighting {
public static final String LIGHT3_SPECULAR = "Lighting.light3.specular";
public static final String LIGHT3_DIFFUSE = "Lighting.light3.diffuse";
public static final String LIGHT3_POSITION = "Lighting.light3.position";
//Data
private List<Light> lights;
......@@ -80,27 +79,27 @@ public class Lighting {
private void createLights() {
lights = new ArrayList<Light>();
Light ambiant = new Light(GL.GL_LIGHT0);
Light ambiant = new Light(GL2.GL_LIGHT0);
ambiant.setEnabled(NbPreferences.forModule(Lighting.class).getBoolean(AMBIANT_ENABLED, true));
ambiant.setAmbiant(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(AMBIANT_AMBIANT, "0.30, 0.33, 0.33, 1.0")));
ambiant.setDiffuse(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(AMBIANT_DIFFUSE, "0.15, 0.10, 0.39, 1.0")));
ambiant.setSpecular(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(AMBIANT_SPECULAR, "0, 0, 0, 1")));
Light light1 = new Light(GL.GL_LIGHT1);
Light light1 = new Light(GL2.GL_LIGHT1);
light1.setEnabled(NbPreferences.forModule(Lighting.class).getBoolean(LIGHT1_ENABLED, true));
light1.setAmbiant(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT1_AMBIANT, "0.0, 0.0, 0.0, 1.0")));
light1.setSpecular(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT1_SPECULAR, "0.91, 0.31, 0.31, 1.0")));
light1.setDiffuse(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT1_DIFFUSE, "0.61, 0.28, 0.20, 1.0")));
light1.setDirection(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT1_POSITION, "-1.0, -1.2, -0.5, 0.0")));
Light light2 = new Light(GL.GL_LIGHT2);
Light light2 = new Light(GL2.GL_LIGHT2);
light2.setEnabled(NbPreferences.forModule(Lighting.class).getBoolean(LIGHT2_ENABLED, true));
light2.setAmbiant(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT2_AMBIANT, "0.0, 0.0, 0.0, 1.0")));
light2.setSpecular(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT2_SPECULAR, "0.96, 0.89, 0.22, 1.0")));
light2.setDiffuse(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT2_DIFFUSE, "0.40, 0.39, 0.18, 1.0")));
light2.setDirection(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT2_POSITION, "2.0, 0.0, 1.0, 0.0")));
Light light3 = new Light(GL.GL_LIGHT3);
Light light3 = new Light(GL2.GL_LIGHT3);
light3.setEnabled(NbPreferences.forModule(Lighting.class).getBoolean(LIGHT3_ENABLED, true));
light3.setAmbiant(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT3_AMBIANT, "0.0, 0.0, 0.0, 1.0")));
light3.setSpecular(PrefsUtils.stringToFloatArray(NbPreferences.forModule(Lighting.class).get(LIGHT3_SPECULAR, "0.37, 0.37, 0.94, 1.0")));
......@@ -117,7 +116,7 @@ public class Lighting {
return lights;
}
public void glInit(GL gl) {
public void glInit(GL2 gl) {
for (int i = 0; i < lights.size(); i++) {
Light l = lights.get(i);
l.glInit(gl);
......@@ -137,20 +136,20 @@ public class Lighting {
this.id = id;
}
public void glInit(GL gl) {
public void glInit(GL2 gl) {
if (enabled) {
gl.glEnable(id);
if (ambiant != null) {
gl.glLightfv(id, GL.GL_AMBIENT, ambiant, 0); // color of the reflected light
gl.glLightfv(id, GL2.GL_AMBIENT, ambiant, 0); // color of the reflected light
}
if (diffuse != null) {
gl.glLightfv(id, GL.GL_DIFFUSE, diffuse, 0); // color of the direct illumination
gl.glLightfv(id, GL2.GL_DIFFUSE, diffuse, 0); // color of the direct illumination
}
if (specular != null) {
gl.glLightfv(id, GL.GL_SPECULAR, specular, 0); // color of the highlight
gl.glLightfv(id, GL2.GL_SPECULAR, specular, 0); // color of the highlight
}
if (direction != null) {
gl.glLightfv(id, GL.GL_POSITION, direction, 0);
gl.glLightfv(id, GL2.GL_POSITION, direction, 0);
}
} else {
gl.glDisable(id);
......@@ -198,4 +197,3 @@ public class Lighting {
}
}
}
......@@ -508,7 +508,7 @@ final class OpenGLPanel extends javax.swing.JPanel {
//OpenGLInfo
GraphicalConfiguration gc = VizController.getInstance().getDrawable().getGraphicalConfiguration();
if (gc != null) {
openInfoText.setText(gc.getVendor() + "\n" + gc.getRenderer() + "\nOpenGL " + gc.getVersionStr());
openInfoText.setText(gc.getVendor() + "\n" + gc.getRenderer() + "\nOpenGL2 " + gc.getVersionStr());
}
}
......
package org.gephi.visualization.scheduler;
import java.util.concurrent.Semaphore;
/**
*
* @author mbastian
*/
public class Animator extends Thread {
//Runnable
protected final Runnable runnable;
//Flag
protected boolean animating = true;
//Lock
protected final Semaphore semaphore;
public Animator(Runnable runnable, Semaphore semaphore, String name) {
super(name);
this.semaphore = semaphore;
this.runnable = runnable;
setDaemon(true);
}
@Override
public void run() {
while (animating) {
synchronized (this) {
try {
wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
runnable.run();
semaphore.release();
}
}
public final void shutdown() {
animating = false;
synchronized (this) {
notify();
}
}
public final boolean isAnimating() {
return animating;
}
}
......@@ -41,20 +41,14 @@
*/
package org.gephi.visualization.scheduler;
import org.gephi.visualization.opengl.CompatibilityEngine;
import java.util.concurrent.Semaphore;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.visualization.VizArchitecture;
import org.gephi.visualization.VizController;
import org.gephi.visualization.apiimpl.Scheduler;
import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.scheduler.FPSAnimator;
import org.gephi.visualization.opengl.CompatibilityEngine;
import org.gephi.visualization.swing.GraphDrawableImpl;
/**
......@@ -75,124 +69,18 @@ public class CompatibilityScheduler implements Scheduler, VizArchitecture {
private GraphDrawableImpl graphDrawable;
private CompatibilityEngine engine;
private VizConfig vizConfig;
//Current GL
private GL gl;
private GLU glu;
//Animator
// private SimpleFPSAnimator simpleFPSAnimator;
//Animators
private FPSAnimator displayAnimator;
private FPSAnimator updateAnimator;
private float displayFpsLimit = 30f;
private float updateFpsLimit = 5f;
private Object lock = new Object();
private Object worldLock = new Object();
@Override
public void initArchitecture() {
this.graphDrawable = VizController.getInstance().getDrawable();
this.engine = (CompatibilityEngine) VizController.getInstance().getEngine();
this.vizConfig = VizController.getInstance().getVizConfig();
initPools();
init();
}
private ThreadPoolExecutor pool1;
private ThreadPoolExecutor pool2;
private Runnable modelSegment;
private Semaphore pool1Semaphore = new Semaphore(0);
private Semaphore pool2Semaphore = new Semaphore(0);
private Runnable selectionSegment;
private Runnable startDragSegment;
private Runnable dragSegment;
private Runnable refreshLimitsSegment;
private Runnable mouseClickSegment;
private void initPools() {
pool1 = new ThreadPoolExecutor(0, 4, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "VisualizationThreadPool 1");
t.setDaemon(true);
return t;
}
}) {
@Override
protected void afterExecute(Runnable r, Throwable t) {
super.afterExecute(r, t);
pool1Semaphore.release();
}
@Override
public void execute(Runnable command) {
super.execute(command);
}
};
pool2 = new ThreadPoolExecutor(0, 4, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "VisualizationThreadPool 2");
t.setDaemon(true);
return t;
}
}) {
@Override
protected void afterExecute(Runnable r, Throwable t) {
super.afterExecute(r, t);
pool2Semaphore.release();
}
@Override
public void execute(Runnable command) {
super.execute(command);
}
};
}
public void init() {
modelSegment = new Runnable() {
@Override
public void run() {
// if (engine.isEnabled()) {
// objClass.lod(engine.getOctree().getObjectIterator(objClass.getClassId()));
// }
}
};
selectionSegment = new Runnable() {
@Override
public void run() {
engine.mouseMove();
}
};
refreshLimitsSegment = new Runnable() {
@Override
public void run() {
}
};
dragSegment = new Runnable() {
@Override
public void run() {
//Drag
if (stopDrag.getAndSet(false)) {
engine.stopDrag();
}
if (startDrag.getAndSet(false)) {
engine.startDrag();
}
if (drag.getAndSet(false)) {
engine.mouseDrag();
}
}
};
mouseClickSegment = new Runnable() {
@Override
public void run() {
engine.mouseClick();
}
};
}
@Override
......@@ -202,12 +90,22 @@ public class CompatibilityScheduler implements Scheduler, VizArchitecture {
public void run() {
graphDrawable.display();
}
}, lock, "DisplayAnimator", displayFpsLimit);
}, worldLock, "DisplayAnimator", displayFpsLimit);
displayAnimator.start();
updateAnimator = new FPSAnimator(new Runnable() {
@Override
public void run() {
updateWorld();
}
}, worldLock, "UpdateAnimator", updateFpsLimit);
updateAnimator.start();
}
@Override
public synchronized void stop() {
updateAnimator.shutdown();
displayAnimator.shutdown();
cameraMoved.set(false);
mouseMoved.set(false);
startDrag.set(false);
......@@ -225,74 +123,51 @@ public class CompatibilityScheduler implements Scheduler, VizArchitecture {
}
@Override
public void display(GL gl, GLU glu) {
public void display(GL2 gl, GLU glu) {
// if (simpleFPSAnimator.isDisplayCall()) {
this.gl = gl;
this.glu = glu;
//Boolean vals
boolean execMouseClick = mouseClick.getAndSet(false);
boolean execMouseMove = mouseMoved.getAndSet(false);
boolean execDrag = drag.get() || startDrag.get() || stopDrag.get();
//Calculate permits
int pool1Permit = 0;
int pool2Permit = 0;
if (execMouseMove) {
pool2Permit++;
} else if (execDrag) {
pool2Permit++;
}
if (execMouseClick) {
pool2Permit++;
}
if (cameraMoved.getAndSet(false)) {
graphDrawable.setCameraPosition(gl, glu);
pool1Permit = 1;
engine.getOctree().updateVisibleOctant(gl);
//Objects iterators in octree are ready
//Task MODEL
pool1.execute(modelSegment);
//Task MODEL - LOD
// pool1.execute(modelSegment);
}
//Task SELECTED
if (execMouseMove) {
engine.updateSelection(gl, glu);
pool2.execute(selectionSegment);
engine.mouseMove();
} else if (execDrag) {
pool2.execute(dragSegment);
//Drag
if (stopDrag.getAndSet(false)) {
engine.stopDrag();
}
if (startDrag.getAndSet(false)) {
engine.startDrag();
}
if (drag.getAndSet(false)) {
engine.mouseDrag();
}
}
//Task AFTERSELECTION
if (execMouseClick) {
pool2.execute(mouseClickSegment);
}
try {
if (pool1Permit > 0) {
pool1Semaphore.acquire(pool1Permit);
}
} catch (Exception e) {
e.printStackTrace();
engine.mouseClick();
}
//Display
engine.beforeDisplay(gl, glu);
engine.display(gl, glu);
engine.afterDisplay(gl, glu);
try {
if (pool2Permit > 0) {
pool2Semaphore.acquire(pool2Permit);
}
} catch (Exception e) {
e.printStackTrace();
}
// }
}
......
package org.gephi.visualization.scheduler;
import org.gephi.visualization.swing.GraphDrawableImpl;
/**
*
* @author mbastian
*/
public class DisplayAnimator implements Runnable {
private final Object worldLock;
private final GraphDrawableImpl drawable;
//Animator
private FPSAnimator animator;
private float displayFpsLimit = 30f;
public DisplayAnimator(GraphDrawableImpl drawable, Object worldLock) {
this.drawable = drawable;
this.worldLock = worldLock;
}
public synchronized void start() {
animator = new FPSAnimator(this, worldLock, "DisplayAnimator", displayFpsLimit);
animator.start();
}
public synchronized void stop() {
if (animator == null) {
return;
}
if (animator.isAnimating()) {
animator.shutdown();
}
}
public boolean isAnimating() {
if (animator != null && animator.isAnimating()) {
return true;
}
return false;
}
public void setFps(float maxFps) {
this.displayFpsLimit = maxFps;
if (animator != null) {
animator.setFps(maxFps);
}
}
@Override
public void run() {
drawable.display();
}
}
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.scheduler;
import org.gephi.visualization.apiimpl.Scheduler;
import java.util.concurrent.atomic.AtomicBoolean;
import org.gephi.visualization.swing.GraphDrawableImpl;
/**
*
* @author Mathieu Bastian
*/
public class SimpleFPSAnimator extends Thread {
private Scheduler scheduler;
private GraphDrawableImpl drawable;
private long delay;
private AtomicBoolean animating;
private final Object lock = new Object();
private boolean displayCall = false;
private long startTime;
public SimpleFPSAnimator(Scheduler scheduler, GraphDrawableImpl drawble, float fps) {
super("SimpleFPSAnimator");
setDaemon(true);
this.drawable = drawble;
this.scheduler = scheduler;
this.animating = new AtomicBoolean();
setFps(fps);
animating.set(true);
}
@Override
public void run() {
try {
while (animating.get()) {
startTime = System.currentTimeMillis();
scheduler.updateWorld();
scheduler.updatePosition();
displayCall = true;
drawable.display();
displayCall = false;
long timeout;
while ((timeout = delay - System.currentTimeMillis() + startTime) > 0) {
//Wait only if the time spent in display is inferior than delay
//Otherwise the render loop acts as a 'as fast as you can' loop
synchronized (this.lock) {
this.lock.wait(timeout);
}
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public void shutdown() {
animating.set(false);
}
public boolean isAnimating() {
return animating.get();
}
public void setFps(float fps) {
delay = (long) (1000.0f / fps);
synchronized (this.lock) {
startTime = 0;
this.lock.notify();
}
}
public boolean isDisplayCall() {
return displayCall;
}
}
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.screenshot;
import org.gephi.visualization.opengl.*;
import com.sun.opengl.util.FileUtil;
import com.sun.opengl.util.ImageUtil;
import com.sun.opengl.util.TileRenderer;
import com.jogamp.opengl.util.awt.ImageUtil;
import com.jogamp.opengl.util.gl2.TileRenderer;
import java.awt.Cursor;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;
......@@ -55,12 +53,14 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.imageio.ImageIO;
import javax.media.opengl.GL;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLPbuffer;
import javax.media.opengl.GLProfile;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
......@@ -68,9 +68,10 @@ import org.gephi.ui.utils.DialogFileFilter;
import org.gephi.visualization.VizArchitecture;
import org.gephi.visualization.VizController;
import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.opengl.text.TextManager;
import org.gephi.visualization.opengl.*;
import org.gephi.visualization.swing.GLAbstractListener;
import org.gephi.visualization.swing.GraphDrawableImpl;
import org.gephi.visualization.text.TextManager;
import org.netbeans.validation.api.ui.ValidationPanel;
import org.openide.util.NbBundle;
import org.openide.util.NbPreferences;
......@@ -122,7 +123,6 @@ public class ScreenshotMaker implements VizArchitecture {
finishedMessage = NbPreferences.forModule(ScreenshotMaker.class).getBoolean(SHOW_MESSAGE, finishedMessage);
}
@Override
public void initArchitecture() {
drawable = VizController.getInstance().getDrawable();
engine = VizController.getInstance().getEngine();
......@@ -134,6 +134,21 @@ public class ScreenshotMaker implements VizArchitecture {
takeTicket = true;
}
private static String getExtension(File f) {
String ext = null;
String s = f.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1) {
ext = s.substring(i + 1).toLowerCase();
}
if (ext == null) {
return "";
}
return ext;
}
private void take(File file) throws Exception {
//System.out.println("Take Screenshot to " + file.getName());
......@@ -144,8 +159,11 @@ public class ScreenshotMaker implements VizArchitecture {
int imageWidth = width;
int imageHeight = height;
GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities caps = new GLCapabilities(profile);
AbstractGraphicsDevice device = GLDrawableFactory.getFactory(profile).getDefaultDevice();
//Caps
GLCapabilities caps = new GLCapabilities();
caps.setAlphaBits(8);
caps.setDoubleBuffered(false);
caps.setHardwareAccelerated(true);
......@@ -153,7 +171,8 @@ public class ScreenshotMaker implements VizArchitecture {
caps.setNumSamples(antiAliasing);
//Buffer
GLPbuffer pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, tileWidth, tileHeight, null);
GLPbuffer pbuffer = GLDrawableFactory.getFactory(profile).createGLPbuffer(device, caps, null, tileWidth, tileHeight, null);
BufferedImage image = null;
if (transparentBackground) {
image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_4BYTE_ABGR);
......@@ -167,9 +186,9 @@ public class ScreenshotMaker implements VizArchitecture {
tileRenderer.setTileSize(tileWidth, tileHeight, 0);
tileRenderer.setImageSize(imageWidth, imageHeight);
if (transparentBackground) {
tileRenderer.setImageBuffer(GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, imageBuffer);
tileRenderer.setImageBuffer(GL2.GL_BGRA, GL2.GL_UNSIGNED_BYTE, imageBuffer);
} else {
tileRenderer.setImageBuffer(GL.GL_BGR, GL.GL_UNSIGNED_BYTE, imageBuffer);
tileRenderer.setImageBuffer(GL2.GL_BGR, GL2.GL_UNSIGNED_BYTE, imageBuffer);
}
tileRenderer.trPerspective(drawable.viewField, (float) imageWidth / (float) imageHeight, drawable.nearDistance, drawable.farDistance);
......@@ -179,8 +198,11 @@ public class ScreenshotMaker implements VizArchitecture {
if (context.makeCurrent() == GLContext.CONTEXT_NOT_CURRENT) {
throw new RuntimeException("Error making pbuffer's context current");
}
GL gl = pbuffer.getGL();
gl.glMatrixMode(GL.GL_MODELVIEW);
System.out.println("Disabling snapshot");
GL2 gl = pbuffer.getGL().getGL2();
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
//Init
......@@ -188,6 +210,7 @@ public class ScreenshotMaker implements VizArchitecture {
vizConfig.setDisableLOD(true);
engine.initScreenshot(gl, GLAbstractListener.glu);
//Textrender - swap to 3D
textManager.setRenderer3d(true);
......@@ -201,6 +224,7 @@ public class ScreenshotMaker implements VizArchitecture {
context.release();
pbuffer.destroy();
//Textrender - back to 2D
textManager.setRenderer3d(false);
vizConfig.setDisableLOD(false);
......@@ -209,18 +233,18 @@ public class ScreenshotMaker implements VizArchitecture {
writeImage(image);
/*Iterator<ImageWriter> iter = ImageIO.getImageWritersByFormatName("png");
if (iter.hasNext()) {
ImageWriter writer = iter.next();
ImageWriteParam iwp = writer.getDefaultWriteParam();
//iwp.setCompressionType("DEFAULT");
//iwp.setCompressionMode(javax.imageio.ImageWriteParam.MODE_EXPLICIT);
//iwp.setCompressionQuality((int)(9*pngCompresssion));
FileImageOutputStream output = new FileImageOutputStream(file);
writer.setOutput(output);
IIOImage img = new IIOImage(image, null, null);
writer.write(null, img, iwp);
writer.dispose();
}*/
if (iter.hasNext()) {
ImageWriter writer = iter.next();
ImageWriteParam iwp = writer.getDefaultWriteParam();
//iwp.setCompressionType("DEFAULT");
//iwp.setCompressionMode(javax.imageio.ImageWriteParam.MODE_EXPLICIT);
//iwp.setCompressionQuality((int)(9*pngCompresssion));
FileImageOutputStream output = new FileImageOutputStream(file);
writer.setOutput(output);
IIOImage img = new IIOImage(image, null, null);
writer.write(null, img, iwp);
writer.dispose();
}*/
//oldContext.makeCurrent();
}
......@@ -257,7 +281,7 @@ public class ScreenshotMaker implements VizArchitecture {
}
String format = "png";
if (file != null) {
format = FileUtil.getFileSuffix(file);
format = getExtension(file);
}
if (!ImageIO.write(image, format, file)) {
throw new IOException("Unsupported file format");
......@@ -289,8 +313,6 @@ public class ScreenshotMaker implements VizArchitecture {
if (finishedMessage && file != null) {
final String msg = NbBundle.getMessage(ScreenshotMaker.class, "ScreenshotMaker.finishedMessage.message", file.getName());
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), msg, NbBundle.getMessage(ScreenshotMaker.class, "ScreenshotMaker.finishedMessage.title"), JOptionPane.INFORMATION_MESSAGE);
}
......
......@@ -41,7 +41,7 @@
*/
package org.gephi.visualization.selection;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.lib.gleem.linalg.Vecf;
import org.gephi.visualization.VizController;
......@@ -114,7 +114,7 @@ public class Cylinder implements SelectionArea {
}
@Override
public void drawArea(GL gl, GLU glu) {
public void drawArea(GL2 gl, GLU glu) {
float diameter = selectionManager.getMouseSelectionDiameter();
if (diameter == 1) {
//Point
......@@ -132,10 +132,10 @@ public class Cylinder implements SelectionArea {
double angle;
if (lighting) {
gl.glDisable(GL.GL_LIGHTING);
gl.glDisable(GL2.GL_LIGHTING);
}
gl.glColor4f(0f, 0f, 0f, 0.2f);
gl.glBegin(GL.GL_TRIANGLES);
gl.glBegin(GL2.GL_TRIANGLES);
for (int i = 0; i <= 360; i++) {
angle = i / 57.29577957795135f;
vectorX = mousePosition[0] + (radius * (float) Math.sin(angle));
......@@ -148,7 +148,7 @@ public class Cylinder implements SelectionArea {
}
gl.glEnd();
if (lighting) {
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL2.GL_LIGHTING);
}
}
}
......
......@@ -42,7 +42,7 @@
package org.gephi.visualization.selection;
import java.util.Arrays;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import org.gephi.lib.gleem.linalg.Vecf;
import org.gephi.visualization.VizController;
......@@ -168,7 +168,7 @@ public class Rectangle implements SelectionArea {
}
@Override
public void drawArea(GL gl, GLU glu) {
public void drawArea(GL2 gl, GLU glu) {
if (!stop) {
float x = startPosition[0];
float y = startPosition[1];
......@@ -176,17 +176,17 @@ public class Rectangle implements SelectionArea {
float h = rectangle[1] - startPosition[1];
//System.out.println("x:"+x+" y:"+y+" w:"+w+" h:"+h);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
glu.gluOrtho2D(0, drawable.getViewportWidth(), 0, drawable.getViewportHeight());
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glColor4f(color[0], color[1], color[2], color[3]);
gl.glBegin(GL.GL_QUADS);
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(x + w, y, 0);
gl.glVertex3f(x, y, 0);
gl.glVertex3f(x, y + h, 0);
......@@ -194,7 +194,7 @@ public class Rectangle implements SelectionArea {
gl.glEnd();
gl.glColor4f(color[0], color[1], color[2], 1f);
gl.glBegin(GL.GL_LINE_LOOP);
gl.glBegin(GL2.GL_LINE_LOOP);
gl.glVertex3f(x + w, y, 0);
gl.glVertex3f(x, y, 0);
gl.glVertex3f(x, y + h, 0);
......@@ -202,9 +202,9 @@ public class Rectangle implements SelectionArea {
gl.glEnd();
gl.glPopMatrix();
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPopMatrix();
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
} else {
startPosition = null;
}
......
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.swing;
import com.sun.opengl.util.BufferUtil;
import com.jogamp.common.nio.Buffers;
import java.awt.Color;
import java.nio.DoubleBuffer;
import java.nio.IntBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GL2;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.glu.GLU;
import org.gephi.visualization.VizController;
......@@ -76,9 +76,9 @@ public abstract class GLAbstractListener implements GLEventListener {
public final float nearDistance = 1.0f;
public final float farDistance = 100000f;
private double aspectRatio = 0;
protected DoubleBuffer projMatrix = BufferUtil.newDoubleBuffer(16);
protected DoubleBuffer modelMatrix = BufferUtil.newDoubleBuffer(16);
protected IntBuffer viewport = BufferUtil.newIntBuffer(4);
protected DoubleBuffer projMatrix = Buffers.newDirectDoubleBuffer(16);
protected DoubleBuffer modelMatrix = Buffers.newDirectDoubleBuffer(16);
protected IntBuffer viewport = Buffers.newDirectIntBuffer(4);
protected GraphicalConfiguration graphicalConfiguration;
protected Lighting lighting = new Lighting();
protected ScreenshotMaker screenshotMaker;
......@@ -88,16 +88,18 @@ public abstract class GLAbstractListener implements GLEventListener {
drawable.addGLEventListener(this);
}
protected abstract void init(GL gl);
protected abstract void init(GL2 gl);
protected abstract void render3DScene(GL gl, GLU glu);
protected abstract void render3DScene(GL2 gl, GLU glu);
protected abstract void reshape3DScene(GL gl);
protected abstract void reshape3DScene(GL2 gl);
protected abstract void setCameraPosition(GL gl, GLU glu);
protected abstract void setCameraPosition(GL2 gl, GLU glu);
protected GLCapabilities getCaps() {
GLCapabilities caps = new GLCapabilities();
GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities caps = new GLCapabilities(profile);
try {
caps.setAlphaBits(8); //if NOT opaque
caps.setDoubleBuffered(true);
......@@ -127,43 +129,43 @@ public abstract class GLAbstractListener implements GLEventListener {
return caps;
}
public void initConfig(GL gl) {
public void initConfig(GL2 gl) {
//Disable Vertical synchro
gl.setSwapInterval(0);
//Depth
if (vizController.getVizModel().isUse3d()) {
gl.glEnable(GL.GL_DEPTH_TEST); //Enable Z-Ordering
gl.glDepthFunc(GL.GL_LEQUAL);
gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); //Correct texture & colors perspective calculations
gl.glEnable(GL2.GL_DEPTH_TEST); //Enable Z-Ordering
gl.glDepthFunc(GL2.GL_LEQUAL);
gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL2.GL_NICEST); //Correct texture & colors perspective calculations
} else {
gl.glDisable(GL.GL_DEPTH_TEST); //Z is set by the order of drawing
gl.glDisable(GL2.GL_DEPTH_TEST); //Z is set by the order of drawing
}
//Cull face
if (vizController.getVizModel().isCulling()) { //When enabled, increases performance but polygons must be drawn counterclockwise
gl.glEnable(GL.GL_CULL_FACE);
gl.glCullFace(GL.GL_BACK); //Hide back face of polygons
gl.glEnable(GL2.GL_CULL_FACE);
gl.glCullFace(GL2.GL_BACK); //Hide back face of polygons
}
//Point Smooth
if (vizController.getVizConfig().isPointSmooth()) { //Only for GL_POINTS
gl.glEnable(GL.GL_POINT_SMOOTH);
gl.glHint(GL.GL_POINT_SMOOTH_HINT, GL.GL_NICEST); //Point smoothing
gl.glEnable(GL2.GL_POINT_SMOOTH);
gl.glHint(GL2.GL_POINT_SMOOTH_HINT, GL2.GL_NICEST); //Point smoothing
} else {
gl.glDisable(GL.GL_POINT_SMOOTH);
gl.glDisable(GL2.GL_POINT_SMOOTH);
}
//Light Smooth
if (vizController.getVizConfig().isLineSmooth()) { //Only for GL_LINES
gl.glEnable(GL.GL_LINE_SMOOTH);
gl.glEnable(GL2.GL_LINE_SMOOTH);
if (vizController.getVizConfig().isLineSmoothNicest()) {
gl.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST);
gl.glHint(GL2.GL_LINE_SMOOTH_HINT, GL2.GL_NICEST);
} else {
gl.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_FASTEST);
gl.glHint(GL2.GL_LINE_SMOOTH_HINT, GL2.GL_FASTEST);
}
} else {
gl.glDisable(GL.GL_LINE_SMOOTH);
gl.glDisable(GL2.GL_LINE_SMOOTH);
}
gl.glClearDepth(1.0f);
......@@ -174,54 +176,54 @@ public abstract class GLAbstractListener implements GLEventListener {
//Lighting
if (vizController.getVizModel().isLighting()) {
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL2.GL_LIGHTING);
setLighting(gl);
gl.glEnable(GL.GL_NORMALIZE); //Normalise colors when glScale used
gl.glShadeModel(GL.GL_SMOOTH);
gl.glEnable(GL2.GL_NORMALIZE); //Normalise colors when glScale used
gl.glShadeModel(GL2.GL_SMOOTH);
} else {
gl.glDisable(GL.GL_LIGHTING);
gl.glShadeModel(GL.GL_FLAT);
gl.glDisable(GL2.GL_LIGHTING);
gl.glShadeModel(GL2.GL_FLAT);
}
//Blending
if (vizController.getVizConfig().isBlending()) {
gl.glEnable(GL.GL_BLEND);
gl.glEnable(GL2.GL_BLEND);
if (vizController.getVizConfig().isBlendCinema()) {
gl.glBlendFunc(GL.GL_CONSTANT_COLOR, GL.GL_ONE_MINUS_SRC_ALPHA); //Black display
gl.glBlendFunc(GL2.GL_CONSTANT_COLOR, GL2.GL_ONE_MINUS_SRC_ALPHA); //Black display
} else {
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); //Use alpha values correctly
gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA); //Use alpha values correctly
}
}
//Material
if (vizController.getVizModel().isMaterial()) {
gl.glColorMaterial(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE);
gl.glEnable(GL.GL_COLOR_MATERIAL); //Use color and avoid using glMaterial
gl.glColorMaterial(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE);
gl.glEnable(GL2.GL_COLOR_MATERIAL); //Use color and avoid using glMaterial
}
//Mesh view
if (vizController.getVizConfig().isWireFrame()) {
gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE);
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
}
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glEnable(GL2.GL_TEXTURE_2D);
}
protected void setLighting(GL gl) {
protected void setLighting(GL2 gl) {
lighting = new Lighting();
lighting.glInit(gl);
}
@Override
public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
GL2 gl = drawable.getGL().getGL2();
graphicalConfiguration = new GraphicalConfiguration();
graphicalConfiguration.checkGeneralCompatibility(gl);
//Reinit viewport, to ensure reshape to perform
viewport = BufferUtil.newIntBuffer(4);
viewport = Buffers.newDirectIntBuffer(4);
resizing = false;
initConfig(gl);
......@@ -244,20 +246,19 @@ public abstract class GLAbstractListener implements GLEventListener {
fps = 1000.0f / delta;
if (fps < 100) {
fpsAvg = (fpsAvg * fpsCount + fps) / ++fpsCount;
}
}
GL gl = drawable.getGL();
GL2 gl = drawable.getGL().getGL2();
if (vizController.getVizModel().isUse3d()) {
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
} else {
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
}
render3DScene(gl, glu);
}
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
if (!resizing) {
if (viewport.get(2) == width && viewport.get(3) == height)//NO need
......@@ -285,39 +286,35 @@ public abstract class GLAbstractListener implements GLEventListener {
viewportX = ((width - viewportW) / 2);
viewportY = ((height - viewportH) / 2);
GL gl = drawable.getGL();
GL2 gl = drawable.getGL().getGL2();
gl.glViewport(viewportX, viewportY, viewportW, viewportH);
gl.glGetIntegerv(GL.GL_VIEWPORT, viewport);//Update viewport buffer
gl.glGetIntegerv(GL2.GL_VIEWPORT, viewport);//Update viewport buffer
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(viewField, aspectRatio, nearDistance, farDistance);
gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projMatrix);//Update projection buffer
gl.glGetDoublev(GL2.GL_PROJECTION_MATRIX, projMatrix);//Update projection buffer
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
reshape3DScene(drawable.getGL());
reshape3DScene(drawable.getGL().getGL2());
if (DEBUG) {
DEBUG = false;
System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
System.err.println("GL_VENDOR: " + gl.glGetString(GL2.GL_VENDOR));
System.err.println("GL_RENDERER: " + gl.glGetString(GL2.GL_RENDERER));
System.err.println("GL_VERSION: " + gl.glGetString(GL2.GL_VERSION));
}
resizing = false;
}
}
public GL getGL() {
return drawable.getGL();
}
@Override
public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {
public GL2 getGL() {
return drawable.getGL().getGL2();
}
public void setVizController(VizController vizController) {
......
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.swing;
import com.sun.opengl.util.GLUT;
import com.jogamp.opengl.util.gl2.GLUT;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.text.NumberFormat;
import javax.media.opengl.GL;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GL2;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.GLU;
import javax.swing.JPopupMenu;
import javax.swing.ToolTipManager;
......@@ -81,25 +80,25 @@ public class GraphCanvas extends GraphDrawableImpl {
}
@Override
protected void render3DScene(GL gl, GLU glu) {
protected void render3DScene(GL2 gl, GLU glu) {
if (vizController.getVizConfig().isShowFPS()) {
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glMatrixMode(gl.GL_PROJECTION);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glGetIntegerv(gl.GL_VIEWPORT, viewport);
gl.glGetIntegerv(GL2.GL_VIEWPORT, viewport);
glu.gluOrtho2D(0, viewport.get(2), viewport.get(3), 0);
gl.glDepthFunc(gl.GL_ALWAYS);
gl.glDepthFunc(GL2.GL_ALWAYS);
gl.glColor3i(192, 192, 192);
gl.glRasterPos2f(10, 15);
String fpsRound = formatter.format(fps);
glut.glutBitmapString(GLUT.BITMAP_HELVETICA_10, fpsRound);
gl.glDepthFunc(gl.GL_LESS);
gl.glDepthFunc(GL2.GL_LESS);
gl.glPopMatrix();
gl.glMatrixMode(gl.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glPopMatrix();
}
super.render3DScene(gl, glu);
......
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.swing;
import com.sun.opengl.util.BufferUtil;
import com.jogamp.common.nio.Buffers;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.glu.GLU;
import org.gephi.visualization.VizArchitecture;
......@@ -79,7 +78,6 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
this.vizController = VizController.getInstance();
}
@Override
public void initArchitecture() {
this.engine = VizController.getInstance().getEngine();
this.scheduler = VizController.getInstance().getScheduler();
......@@ -93,7 +91,6 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
final int minVal = vizController.getVizConfig().getReduceFpsWhenMouseOutValue();
final int maxVal = 30;
graphMouseAdapter = new MouseAdapter() {
private float lastTarget = 0.1f;
@Override
......@@ -124,7 +121,6 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
graphComponent.addMouseListener(graphMouseAdapter);
} else if (vizController.getVizConfig().isPauseLoopWhenMouseOut()) {
graphMouseAdapter = new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
engine.startDisplay();
......@@ -140,14 +136,14 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
}
@Override
protected void init(GL gl) {
protected void init(GL2 gl) {
//System.out.println("init");
graphComponent.setCursor(Cursor.getDefaultCursor());
// graphComponent.setCursor(Cursor.getDefaultCursor());
engine.initEngine(gl, glu);
}
public void destroy() {
if(graphMouseAdapter != null) {
if (graphMouseAdapter != null) {
graphComponent.removeMouseListener(graphMouseAdapter);
}
}
......@@ -155,13 +151,13 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
public void refreshDraggingMarker() {
//Refresh dragging marker
/*DoubleBuffer objPos = BufferUtil.newDoubleBuffer(3);
glu.gluProject(0, 0, 0, modelMatrix, projMatrix, viewport, objPos);
double dxx = objPos.get(0);
double dyy = objPos.get(1);
glu.gluProject(1, 1, 0, modelMatrix, projMatrix, viewport, objPos);
draggingMarker[0] = dxx - objPos.get(0);
draggingMarker[1] = dyy - objPos.get(1);
System.out.print(draggingMarker[0]);*/
glu.gluProject(0, 0, 0, modelMatrix, projMatrix, viewport, objPos);
double dxx = objPos.get(0);
double dyy = objPos.get(1);
glu.gluProject(1, 1, 0, modelMatrix, projMatrix, viewport, objPos);
draggingMarker[0] = dxx - objPos.get(0);
draggingMarker[1] = dyy - objPos.get(1);
System.out.print(draggingMarker[0]);*/
double[] v = {0, 0, 0, 1.0};
double[] v2 = {1.0, 1.0, 0, 1.0};
......@@ -175,33 +171,33 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
}
@Override
public void setCameraPosition(GL gl, GLU glu) {
public void setCameraPosition(GL2 gl, GLU glu) {
//Refresh rotation angle
gl.glLoadIdentity();
glu.gluLookAt(cameraLocation[0], cameraLocation[1], cameraLocation[2], cameraTarget[0], cameraTarget[1], cameraTarget[2], 0, 1, 0);
gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelMatrix);
gl.glGetDoublev(GL2.GL_MODELVIEW_MATRIX, modelMatrix);
cameraVector.set(cameraTarget[0] - cameraLocation[0], cameraTarget[1] - cameraLocation[1], cameraTarget[2] - cameraLocation[2]);
refreshDraggingMarker();
}
@Override
protected void reshape3DScene(GL gl) {
protected void reshape3DScene(GL2 gl) {
setCameraPosition(gl, glu);
graphComponent.invalidate(); //Force canvas to be laid out with the proper size
}
@Override
protected void render3DScene(GL gl, GLU glu) {
protected void render3DScene(GL2 gl, GLU glu) {
scheduler.display(gl, glu);
//renderTestCube(gl);
}
private void renderTestCube(GL gl) {
private void renderTestCube(GL2 gl) {
float cubeSize = 100f;
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
glu.gluLookAt(cameraLocation[0], cameraLocation[1], cameraLocation[2], cameraTarget[0], cameraTarget[1], cameraTarget[2], 0, 1, 0);
......@@ -210,7 +206,7 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
gl.glRotatef(15.0f, 0.0f, 1.0f, 0.0f); // Rotate The cube around the Y axis
gl.glRotatef(15.0f, 1.0f, 1.0f, 1.0f);
gl.glBegin(GL.GL_QUADS); // Draw The Cube Using quads
gl.glBegin(GL2.GL_QUADS); // Draw The Cube Using quads
gl.glColor3f(0.0f, 1.0f, 0.0f); // Color Blue
gl.glVertex3f(cubeSize, cubeSize, -cubeSize); // Top Right Of The Quad (Top)
gl.glVertex3f(-cubeSize, cubeSize, -cubeSize); // Top Left Of The Quad (Top)
......@@ -245,11 +241,11 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
}
public void renderScreenshot(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
GL2 gl = drawable.getGL().getGL2();
if (vizController.getVizModel().isUse3d()) {
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
} else {
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
}
setCameraPosition(gl, glu);
engine.display(gl, glu);
......@@ -293,63 +289,71 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
return out;
}
private float[] toFloatArray(double[] arr) {
if (arr == null) {
return null;
}
int n = arr.length;
float[] ret = new float[n];
for (int i = 0; i < n; i++) {
ret[i] = (float) arr[i];
}
return ret;
}
public double[] gluUnProject(float x, float y, float z) {
DoubleBuffer buffer = BufferUtil.newDoubleBuffer(3);
glu.gluUnProject(x, y, z, modelMatrix, projMatrix, viewport, buffer);
return new double[]{buffer.get(0), buffer.get(1), buffer.get(2)};
FloatBuffer buffer = Buffers.newDirectFloatBuffer(3);
/* FIXME jbilcke: not sure about this whole double-to-float-to-double thing */
FloatBuffer modelMatrixBuffer = Buffers.newDirectFloatBuffer(modelMatrix.capacity());
modelMatrixBuffer.put(toFloatArray(modelMatrix.array()));
FloatBuffer projMatrixBuffer = Buffers.newDirectFloatBuffer(projMatrix.capacity());
projMatrixBuffer.put(toFloatArray(projMatrix.array()));
glu.gluProject(x, y, z, modelMatrixBuffer, projMatrixBuffer, viewport, buffer);
return new double[]{(double) buffer.get(0), (double) buffer.get(1), (double) buffer.get(2)};
}
@Override
public float[] getCameraLocation() {
return cameraLocation;
}
@Override
public void setCameraLocation(float[] cameraLocation) {
this.cameraLocation = cameraLocation;
}
@Override
public float[] getCameraTarget() {
return cameraTarget;
}
@Override
public void setCameraTarget(float[] cameraTarget) {
this.cameraTarget = cameraTarget;
}
@Override
public Component getGraphComponent() {
return graphComponent;
}
@Override
public Vec3f getCameraVector() {
return cameraVector;
}
@Override
public int getViewportHeight() {
return viewport.get(3);
}
@Override
public int getViewportWidth() {
return viewport.get(2);
}
@Override
public double getDraggingMarkerX() {
return draggingMarker[0];
}
@Override
public double getDraggingMarkerY() {
return draggingMarker[1];
}
@Override
public DoubleBuffer getProjectionMatrix() {
return projMatrix;
}
......@@ -358,8 +362,12 @@ public class GraphDrawableImpl extends GLAbstractListener implements VizArchitec
return modelMatrix;
}
@Override
public IntBuffer getViewport() {
return viewport;
}
@Override
public void dispose(GLAutoDrawable glad) {
/* FIXME: jbilcke: what should it do? is it new in JOGL2? */
}
}
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.swing;
import java.awt.Color;
......@@ -46,8 +46,7 @@ import java.awt.Cursor;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.text.NumberFormat;
import javax.media.opengl.GLJPanel;
import javax.media.opengl.awt.GLJPanel;
import org.gephi.visualization.GraphLimits;
import org.gephi.visualization.VizController;
......@@ -67,8 +66,7 @@ public class GraphPanel extends GraphDrawableImpl {
//Init GLJPanel as the drawable
gljPanel = new GLJPanel(getCaps(), null, null) {
@Override
//@Override
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
render2DBackground(g2d);
......
......@@ -39,12 +39,12 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import javax.swing.ImageIcon;
import org.gephi.visualization.model.edge.EdgeModel;
import org.gephi.visualization.model.node.NodeModel;
import org.gephi.visualization.opengl.text.TextManager.Renderer;
import org.gephi.visualization.text.TextManager.Renderer;
/**
*
......
......@@ -39,7 +39,7 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import javax.swing.ImageIcon;
import org.gephi.visualization.VizController;
......
......@@ -39,7 +39,7 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import javax.swing.ImageIcon;
import org.gephi.visualization.VizController;
......@@ -47,7 +47,7 @@ import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.model.TextModel;
import org.gephi.visualization.model.edge.EdgeModel;
import org.gephi.visualization.model.node.NodeModel;
import org.gephi.visualization.opengl.text.TextManager.Renderer;
import org.gephi.visualization.text.TextManager.Renderer;
/**
*
......
......@@ -39,7 +39,7 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import javax.swing.ImageIcon;
import org.gephi.visualization.model.node.NodeModel;
......
......@@ -39,7 +39,7 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import javax.swing.ImageIcon;
import org.gephi.visualization.model.node.NodeModel;
......
......@@ -39,7 +39,7 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import javax.swing.ImageIcon;
import org.gephi.visualization.model.node.NodeModel;
......
......@@ -39,9 +39,9 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import com.sun.opengl.util.j2d.TextRenderer;
import com.jogamp.opengl.util.awt.TextRenderer;
import java.awt.Font;
import java.awt.geom.Rectangle2D;
import java.beans.PropertyChangeEvent;
......
......@@ -39,7 +39,7 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import java.awt.Color;
import java.awt.Font;
......
......@@ -39,7 +39,7 @@
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.visualization.opengl.text;
package org.gephi.visualization.text;
import javax.swing.ImageIcon;
import org.gephi.visualization.VizController;
......@@ -47,7 +47,7 @@ import org.gephi.visualization.apiimpl.VizConfig;
import org.gephi.visualization.model.TextModel;
import org.gephi.visualization.model.edge.EdgeModel;
import org.gephi.visualization.model.node.NodeModel;
import org.gephi.visualization.opengl.text.TextManager.Renderer;
import org.gephi.visualization.text.TextManager.Renderer;
/**
*
......
......@@ -2,6 +2,5 @@ Manifest-Version: 1.0
AutoUpdate-Essential-Module: true
OpenIDE-Module-Layer: org/gephi/visualization/layer.xml
OpenIDE-Module-Localizing-Bundle: org/gephi/visualization/Bundle.properties
OpenIDE-Module-Install: org/gephi/visualization/opengl/JOGLNativesInstaller.class
OpenIDE-Module-Hide-Classpath-Packages: javax.media.opengl.**, com.sun.opengl.**, com.sun.gluegen.runtime.**
OpenIDE-Module-Hide-Classpath-Packages: javax.media.openGL2.**, com.sun.openGL2.**, com.sun.gluegen.runtime.**
OpenIDE-Module-Specification-Version: ${gephi.modules.specification.version}
\ No newline at end of file
graphicalConfiguration_currentConfig = "\nCurrent hardware:\n%s\n%s\nVersion:%s;
graphicalConfiguration_exception = "Your OpenGL version (%s) is too low to display the graph.\nUpdate your graphical drivers or configuration.%s
graphicalConfiguration_exception = "Your OpenGL2 version (%s) is too low to display the graph.\nUpdate your graphical drivers or configuration.%s
......@@ -8,4 +8,4 @@
graphicalConfiguration_currentConfig="\nSou\u010dasn\u00fd hardware\:\n%s\n%s\nVerze\:%s;
graphicalConfiguration_exception="Va\u0161e verze OpenGL (%s) je p\u0159\u00edli\u0161 n\u00edzk\u00e1 pro zobrazen\u00ed grafu.\nAktualizujte Va\u0161e grafick\u00e9 ovlada\u010de nebo nastaven\u00ed.%s
graphicalConfiguration_exception="Va\u0161e verze OpenGL2 (%s) je p\u0159\u00edli\u0161 n\u00edzk\u00e1 pro zobrazen\u00ed grafu.\nAktualizujte Va\u0161e grafick\u00e9 ovlada\u010de nebo nastaven\u00ed.%s
......@@ -9,4 +9,4 @@
graphicalConfiguration_currentConfig="\nHardware actual\:\n%s\n%s\nVersi\u00f3n\:%s;
graphicalConfiguration_exception=Tu versi\u00f3n de OpenGL (%s) es demasiado baja para mostrar el grafo.\nActualiza los controladores gr\u00e1ficos o su configuraci\u00f3n.%s
graphicalConfiguration_exception=Tu versi\u00f3n de OpenGL2 (%s) es demasiado baja para mostrar el grafo.\nActualiza los controladores gr\u00e1ficos o su configuraci\u00f3n.%s
......@@ -9,4 +9,4 @@
graphicalConfiguration_currentConfig="\nMat\u00e9riel actuel\:\n%s\n%s\nVersion\:%s;
graphicalConfiguration_exception=Votre version d'OpenGL (%s) est trop ancienne pour afficher le graphe.\nMettez \u00e0 jour votre pilote graphique ou votre configuration mat\u00e9rielle. %s
graphicalConfiguration_exception=Votre version d'OpenGL2 (%s) est trop ancienne pour afficher le graphe.\nMettez \u00e0 jour votre pilote graphique ou votre configuration mat\u00e9rielle. %s
......@@ -8,4 +8,4 @@
graphicalConfiguration_currentConfig="\nHardware atual\:\n%s\n%s\nVers\u00e3o\:%s;
graphicalConfiguration_exception="Sua vers\u00e3o de OpenGL (%s) n\u00e3o \u00e9 suficiente para exibir o grafo. Atualize seus drivers gr\u00e1ficos ou de configura\u00e7\u00e3o.%s
graphicalConfiguration_exception="Sua vers\u00e3o de OpenGL2 (%s) n\u00e3o \u00e9 suficiente para exibir o grafo. Atualize seus drivers gr\u00e1ficos ou de configura\u00e7\u00e3o.%s
......@@ -8,4 +8,4 @@
graphicalConfiguration_currentConfig="\n\u0410\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435\: \n%s\n%s\n\u0412\u0435\u0440\u0441\u0438\u044f\:%s;
graphicalConfiguration_exception="\u0412\u0430\u0448\u0430 \u0432\u0435\u0440\u0441\u0438\u044f OpenGL (%s) \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0430.\n\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435.%s
graphicalConfiguration_exception="\u0412\u0430\u0448\u0430 \u0432\u0435\u0440\u0441\u0438\u044f OpenGL2 (%s) \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0430.\n\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435.%s
......@@ -22,4 +22,4 @@ msgid "graphicalConfiguration_currentConfig"
msgstr "\"\nSoučasný hardware:\n%s\n%s\nVerze:%s;"
msgid "graphicalConfiguration_exception"
msgstr "\"Vaše verze OpenGL (%s) je příliš nízká pro zobrazení grafu.\nAktualizujte Vaše grafické ovladače nebo nastavení.%s"
msgstr "\"Vaše verze OpenGL2 (%s) je příliš nízká pro zobrazení grafu.\nAktualizujte Vaše grafické ovladače nebo nastavení.%s"
......@@ -23,4 +23,4 @@ msgid "graphicalConfiguration_currentConfig"
msgstr "\"\nHardware actual:\n%s\n%s\nVersión:%s;"
msgid "graphicalConfiguration_exception"
msgstr "Tu versión de OpenGL (%s) es demasiado baja para mostrar el grafo.\nActualiza los controladores gráficos o su configuración.%s"
msgstr "Tu versión de OpenGL2 (%s) es demasiado baja para mostrar el grafo.\nActualiza los controladores gráficos o su configuración.%s"
......@@ -23,4 +23,4 @@ msgid "graphicalConfiguration_currentConfig"
msgstr "\"\nMatériel actuel:\n%s\n%s\nVersion:%s;"
msgid "graphicalConfiguration_exception"
msgstr "Votre version d'OpenGL (%s) est trop ancienne pour afficher le graphe.\nMettez à jour votre pilote graphique ou votre configuration matérielle. %s"
msgstr "Votre version d'OpenGL2 (%s) est trop ancienne pour afficher le graphe.\nMettez à jour votre pilote graphique ou votre configuration matérielle. %s"
......@@ -25,5 +25,5 @@ msgstr ""
msgid "graphicalConfiguration_exception"
msgstr ""
"\"Your OpenGL version (%s) is too low to display the graph.\n"
"\"Your OpenGL2 version (%s) is too low to display the graph.\n"
"Update your graphical drivers or configuration.%s"
......@@ -22,4 +22,4 @@ msgid "graphicalConfiguration_currentConfig"
msgstr "\"\nHardware atual:\n%s\n%s\nVersão:%s;"
msgid "graphicalConfiguration_exception"
msgstr "\"Sua versão de OpenGL (%s) não é suficiente para exibir o grafo. Atualize seus drivers gráficos ou de configuração.%s"
msgstr "\"Sua versão de OpenGL2 (%s) não é suficiente para exibir o grafo. Atualize seus drivers gráficos ou de configuração.%s"
......@@ -22,4 +22,4 @@ msgid "graphicalConfiguration_currentConfig"
msgstr "\"\nАппаратное обеспечение: \n%s\n%s\nВерсия:%s;"
msgid "graphicalConfiguration_exception"
msgstr "\"Ваша версия OpenGL (%s) устарела и не может быть использована для отображения графа.\nОбновите ваши графические драйвера или аппаратное обеспечение.%s"
msgstr "\"Ваша версия OpenGL2 (%s) устарела и не может быть использована для отображения графа.\nОбновите ваши графические драйвера или аппаратное обеспечение.%s"
......@@ -3,7 +3,7 @@ AdvancedOption_DisplayName_OpenGL=OpenGL
AdvancedOption_Keywords_Default=visualization, color
AdvancedOption_Keywords_OpenGL=opengl, antialiasing
AdvancedOption_Tooltip_Default=Default Visualization Settings
AdvancedOption_Tooltip_OpenGL=OpenGL Engine Settings
AdvancedOption_Tooltip_OpenGL=OpenGL2 Engine Settings
OptionsCategory_Keywords_Visualization=visualization, opengl
OptionsCategory_Name_Visualization=Visualization
OptionsCategory_Title_Visualization=Visualization
......
......@@ -31,7 +31,7 @@ msgid "AdvancedOption_Tooltip_Default"
msgstr "Default Visualization Settings"
msgid "AdvancedOption_Tooltip_OpenGL"
msgstr "OpenGL Engine Settings"
msgstr "OpenGL2 Engine Settings"
msgid "OptionsCategory_Keywords_Visualization"
msgstr "visualization, opengl"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册