Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26900/src/net/sourceforge/bprocessor/gl/view
Modified Files:
Display.java
Log Message:
selecting mechanics
Index: Display.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** Display.java 10 Oct 2007 11:39:46 -0000 1.25
--- Display.java 10 Oct 2007 12:43:52 -0000 1.26
***************
*** 60,63 ****
--- 60,66 ----
private static boolean construction;
+ private static Project project;
+ private static Camera camera;
+ private static Space active;
private static float[] white = new float[] {1.0f, 1.0f, 1.0f};
***************
*** 578,588 ****
}
! private static void draw(Space space, boolean active) {
! Project project = Project.getInstance();
! Camera camera = project.getCurrentCamera();
! if (!active) {
! active = project.getActiveSpace() == space;
! }
!
Set<Geometric> hidden = new HashSet();
hidden.addAll(camera.getHiddenGeometrics());
--- 581,585 ----
}
! private static void draw(Space space, boolean inside) {
Set<Geometric> hidden = new HashSet();
hidden.addAll(camera.getHiddenGeometrics());
***************
*** 642,646 ****
{
! if (selecting() || (space instanceof Net && space == project.getActiveSpace())) {
Set<Vertex> visible = new HashSet();
for (Edge current : edges) {
--- 639,643 ----
{
! if (selecting() || (space instanceof Net && space == active)) {
Set<Vertex> visible = new HashSet();
for (Edge current : edges) {
***************
*** 679,694 ****
if (selecting()) {
! if (active) {
selectSurfaces(surfaces);
}
! selectEdges(edges);
if (construction()) {
selectConstructors(constructors);
}
} else {
! if (active) {
drawSurfaces(surfaces);
}
! if (project.getActiveSpace() == space) {
if (construction()) {
gl.glDepthMask(false);
--- 676,693 ----
if (selecting()) {
! if (inside) {
selectSurfaces(surfaces);
}
! if (inside || intersecting()) {
! selectEdges(edges);
! }
if (construction()) {
selectConstructors(constructors);
}
} else {
! if (inside) {
drawSurfaces(surfaces);
}
! if (active == space) {
if (construction()) {
gl.glDepthMask(false);
***************
*** 710,714 ****
size = 1.0f;
}
! if (active) {
color = black;
} else {
--- 709,713 ----
size = 1.0f;
}
! if (inside) {
color = black;
} else {
***************
*** 724,728 ****
if (selecting()) {
! selectVertices(vertices);
} else {
float[] color;
--- 723,729 ----
if (selecting()) {
! if (inside || intersecting()) {
! selectVertices(vertices);
! }
} else {
float[] color;
***************
*** 736,740 ****
for (Space current : elements) {
! draw(current, active);
}
}
--- 737,741 ----
for (Space current : elements) {
! draw(current, inside || (current == active));
}
}
***************
*** 863,868 ****
gl = gld.getGL();
initialize();
! Space world = Project.getInstance().world();
! draw(world, false);
{
--- 864,872 ----
gl = gld.getGL();
initialize();
! project = Project.getInstance();
! camera = project.getCurrentCamera();
! active = project.getActiveSpace();
! Space world = project.world();
! draw(world, world == active);
{
|