}
@Override
public void display(GL 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);
setViewportPosition(obj);
}
markTime++;
CompatibilityModelClass edgeClass = modelClasses[AbstractEngine.CLASS_EDGE];
CompatibilityModelClass nodeClass = modelClasses[AbstractEngine.CLASS_NODE];
CompatibilityModelClass arrowClass = modelClasses[AbstractEngine.CLASS_ARROW];
CompatibilityModelClass potatoClass = modelClasses[AbstractEngine.CLASS_POTATO];
VizModel vizModel = VizController.getInstance().getVizModel();
//Potato
if (potatoClass.isEnabled()) {
potatoClass.beforeDisplay(gl, glu);
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_POTATO); itr.hasNext();) {
ModelImpl obj = itr.next();
if (obj.markTime != markTime) {
obj.display(gl, glu, vizModel);
obj.markTime = markTime;
}
}
potatoClass.afterDisplay(gl, glu);
}
//Edges
if (edgeClass.isEnabled()) {
edgeClass.beforeDisplay(gl, glu);
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_EDGE); itr.hasNext();) {
ModelImpl obj = itr.next();
//Renderable renderable = obj.getObj();
if (obj.markTime != markTime) {
obj.display(gl, glu, vizModel);
obj.markTime = markTime;
}
}
edgeClass.afterDisplay(gl, glu);
}
//Arrows
if (arrowClass.isEnabled()) {
arrowClass.beforeDisplay(gl, glu);
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_ARROW); itr.hasNext();) {
ModelImpl obj = itr.next();
if (obj.markTime != markTime) {
obj.display(gl, glu, vizModel);
obj.markTime = markTime;
}
}
arrowClass.afterDisplay(gl, glu);
}
//Nodes
if (nodeClass.isEnabled()) {
nodeClass.beforeDisplay(gl, glu);
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_NODE); itr.hasNext();) {
ModelImpl obj = itr.next();
if (obj.markTime != markTime) {
obj.display(gl, glu, vizModel);
obj.markTime = markTime;
}
}
nodeClass.afterDisplay(gl, glu);
}
//Labels
if (vizModel.getTextModel().isShowNodeLabels() || vizModel.getTextModel().isShowEdgeLabels()) {
markTime++;
if (nodeClass.isEnabled() && vizModel.getTextModel().isShowNodeLabels()) {
textManager.getNodeRenderer().beginRendering();
textManager.defaultNodeColor();
if (textManager.isSelectedOnly()) {
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_NODE); itr.hasNext();) {
ModelImpl obj = itr.next();
if (obj.markTime != markTime) {
if ((obj.isSelected() || obj.isHighlight()) && obj.getObj().getTextData().isVisible()) {
textManager.getNodeRenderer().drawTextNode(obj);
}
obj.markTime = markTime;
}
}
} else {
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_NODE); itr.hasNext();) {
ModelImpl obj = itr.next();
if (obj.markTime != markTime) {
if (obj.getObj().getTextData().isVisible()) {
textManager.getNodeRenderer().drawTextNode(obj);
}
obj.markTime = markTime;
}
}
}
textManager.getNodeRenderer().endRendering();
}
if (edgeClass.isEnabled() && vizModel.getTextModel().isShowEdgeLabels()) {
textManager.getEdgeRenderer().beginRendering();
textManager.defaultEdgeColor();
if (textManager.isSelectedOnly()) {
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_EDGE); itr.hasNext();) {
ModelImpl obj = itr.next();
if (obj.markTime != markTime) {
if ((obj.isSelected() || obj.isHighlight()) && obj.getObj().getTextData().isVisible()) {
textManager.getEdgeRenderer().drawTextEdge(obj);
}
obj.markTime = markTime;
}
}
} else {
for (Iterator<ModelImpl> itr = octree.getObjectIterator(AbstractEngine.CLASS_EDGE); itr.hasNext();) {
ModelImpl obj = itr.next();
if (obj.markTime != markTime) {
if (obj.getObj().getTextData().isVisible()) {
textManager.getEdgeRenderer().drawTextEdge(obj);
}
obj.markTime = markTime;
}
}