Category Archives: VISIBILITY

Mike 3.13.2012

  • Usual backups this morning
  • Read some CASPORT documentation at site looking how to integrate more with it
  • Back at the mill making a PKI test project and new security library jar
  • Demo moved up to 1:30, we’ll first be giving a general demo of Visibility to a new group of people, then one to the planned group followed by some training on everything

 

My thoughts on PKI/CASPORT integration, step by step:

  1. A users connects to a flex application via HTTPS
  2. A servlet filter intercepts the requests
  3. The filter gets the X509Cert  and retrieves users details from CASPORT, if a cert is not found the session is rejected: the end
  4. The filter places the cert and user information on the session for later access
  5. Upon creation complete of the flex app, the application asks the user service for the user
  6. The user service checks for information on the session:
    1. If not there, null is returned and a log in screen is displayed as it is now
    2. If it is found, the user service checks the database for a matching users
      1. User not found in DB: log in screen is displayed, upon successful log in the userDN is stored in the databases for future use and no log in screen will be displayed again for that user
      2. User found in DB: user service returns the UserInfoObject and the log in screen is skipped

We will have to add a new unique column to the user table called ‘userDN’ which uniquely identifies each user.  The value is provided by CASPORT when looking them up via their cert.

This scheme will allow us to continue using our existing user management schemes, not require wiping the user base, and, a logging in 1 time, the system will use PKI certs to log in from that point on.

Phil 3.13.12

8:00 – 1:00 FP

  • Working on turning the base classes of ShaderLearning2 into a library
  • Creating DLL and static libraries in Visual Studio 2010: http://msdn.microsoft.com/en-us/library/bb384835.aspx
  • Adding copies of headers and libs to the dll project. Trying to make this self-contained.
    • Added include directories to properties
    • Added lib directories to properties
    • Added the following additional dependencies under Linker->Input->Additional Dependencies:
      • opengl32.lib
        glu32.lib
        fltkgl.lib
        FLTKD.LIB
        WSOCK32.LIB
        gltools.lib
    • Yay! My test (Dprintf) is compiling and linking. Onward!
    • Added the following to the “Ignore Specific Libraries”
      • msvcrt.lib
        LIBCMT.lib
    • Done with the debug version of the library, need to verify that it works, then do the release version.

1:00 – 4:00 VISIBILITY

  • Demo – 2, actually. It went well, though we do need to add a ‘loading’ screen to the main project screen. It hung for an awkwardly long time.

Mike 3.12.2012

  • Did one final proof read of my quickstart guide before burning it to CD
  • Watched an interesting video on software development concepts
  • Looking in to fully integrating Visibility with PKI to remove the log in screens
    • Technically it is pretty straightforward to grab the user’s cert and get their SID and userDN
    • The hard part is the migration from the current user tables (one for PPM and one for Visibility) to using userDNs and linking permissions, etc.
    • The easiest thing may be to add a new column to the database, userDN, and when they log in, if userDN is null, set it and use it for look ups in the future.  All users would be created the same way as they are now then log in once and use PKI forever after.
  • Loaded Dong’s updates on my CD as well
  • I will head to fort this afternoon and deploy the following:
    • Quickstart HTML
    • Update to PPA HTML
    • Update to PPA help button
    • Update to VisibilityScripting script engine which will resolve some issues regarding packet too large errors
  • I will also do the normal backups
  • Will create the final table and view for the demo tomorrow: the historic look at project statuses
  • Hopefully will be able to meet with Sherri and show her the view

Phil 3.12.12

8:00 – 1:00 FP

  • DST == sleeeeeeepy
  • Class from 10:00 – 12:00
  • Going to start converting the hand to the new framework. I need to put some of these parts in a library.
  • Cool thing for the day: http://vimeo.com/36579366

1:00 – 4:00 VISIBILITY

  • Demo prep. Need to build a spreadsheet that has projects and timelines on them. Have a “most recent issue” column. Maybe a “number of times underbudget”  and “number of times late” columns as well
  • The demo is now tomorrow at 2:00, though Dukes will not be there. So it looks like we will have an additional meeting/demo.
  • Spent some time walking Sherry P through VISIBILITY and created an account for her on fgmdev Viztool

Mike 3.9.2012

  • Usual backups this morning.  The databases suddenly became a lot smaller, I’m not sure why.  It is 60% the size it was 2 days ago but the project list seemed the right length and neither Tangie or Chrinstina mentioned anything.
  • Dong stopped by and we fixed the packet size issue and tested it.
  • Testing our trending capabilities with some fake data.
  • Finished the PPA quick start guide and exported it to HTML and DOC to bring inside

Phil 3.9.12

8:00 – FP

  • Chasing down why the refresh rate drops after using glGetQueryObjectiv(drawQuery, GL_QUERY_RESULT, &result);
    • Adding a check to test that the result is available before pulling it.
    • Changed the code so that the hit test is only called once per mouse click. Not sure why that would fix it, but I’m not complaining.
    • Cleaned up and working. Example code for how to do non-fixed pipeline picking in OpenGL shown below:
// Code to show how to use object queries to get picking behavior. For this code to work,
// You'll need to add your preferred rendering framework. This code was pulled from an
// FLTK framework I've been building for data visualization

// Class-wide global variables here for the sake of a compact file
// Classes that are not part of the OpenGl library are from the OpenGl SuperBible,
// which I highly reccomend: http://www.starstonesoftware.com/OpenGL/

GLMatrixStack modelViewMatrix;
GLMatrixStack projectionMatrix;
GLFrustum viewFrustum;
bool isPicking;

// Constructor. Set up picking and the projection and model matrices
PickingExample::PickingExample(int x,int y,int w,int h,const char *l)
: Fl_Gl_Window(x,y,w,h,l)
{
	isPicking = false;
	pickQueryResult = READY;
	glGenQueries(1, &pickQueryID);
	if(pickQueryID == 0){
		pickQueryResult = PICK_ERROR;
	}

	viewFrustum.SetPerspective(45.0f, (float)screenWidth/(float)screenHeight, 0.5f, 1000.0f);
	projectionMatrix.LoadMatrix(viewFrustum.GetProjectionMatrix());
	modelViewMatrix.LoadIdentity();
}

// A slightly modified version of the original gluPickMatrix, taken from:
// http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/ogl-sample/main/gfx/lib/glu/libutil/project.c?rev=1.4;content-type=text%2Fplain
void PickingExample::setPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, GLint viewport[4])
{
	if (deltax <= 0 || deltay <= 0) {
		return;
	}

	projectionMatrix.LoadIdentity();

	/* Translate and scale the picked region to the entire window */
	GLfloat dx = (float)((viewport[2] - 2 * (x - viewport[0])) / deltax);
	GLfloat dy = (float)((viewport[3] - 2 * (y - viewport[1])) / deltay);
	projectionMatrix.Translate(dx, dy, 0);
	projectionMatrix.Scale((float)(viewport[2] / deltax), (float)(viewport[3] / deltay), 1.0);

	projectionMatrix.MultMatrix(viewFrustum.GetProjectionMatrix());
}

// the main drawing method. In this case, only drawing for picking is done, though it would 
// be easy enough to glClear() afther the picking code, and draw everything  over again with 
// a normal perspective
void PickingExample::draw() {
	GLint result;
	GLint viewport[4];
	glGetIntegerv(GL_VIEWPORT,viewport);

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	modelViewMatrix.PushMatrix();

		// Have some Euler angle rotations and translations just to show how
		// setPickMatrix() doesn't care about eye or model position

		// global eye transformations
		modelViewMatrix.Rotate(eyeOrient[1], 0, 1, 0);
		modelViewMatrix.Rotate(eyeOrient[0], 1, 0, 0);
		modelViewMatrix.Translate(eyePos[0], eyePos[1], eyePos[2]);

		// global world transformations
		modelViewMatrix.Translate(worldPos[0], worldPos[1], worldPos[2]);
		modelViewMatrix.Rotate(worldOrient[0], 1, 0, 0);
		modelViewMatrix.Rotate(worldOrient[1], 0, 1, 0);

		// set up picking
		if(isPicking && (pickQueryResult != PICK_ERROR))
			projectionMatrix.PushMatrix();
				// set the projection matrix so that it's just looking at a (in this case) 10x10 pixel area
				// near the cursor. This method (shown above)
				setPickMatrix(mouseX,viewport[3]-mouseY,10,10,viewport);

				// for each item that you want to test, bracket it with a glBeginQuery()/glEndQuery()
				// You'll need a unique pickQueryID for each model
				glBeginQuery(GL_ANY_SAMPLES_PASSED, pickQueryID);

					// render your model associated with pickQueryID here. It is assumed that
					// the projection matrix and the model matrix will be handled by your shader(s)

				// finish the query for this particular model
				glEndQuery(GL_ANY_SAMPLES_PASSED);

			projectionMatrix.PopMatrix();

			// For each item that you queried above, see if at least one pixel was drawn
			// Again, you'll need a unique pickQueryID for each model
			glGetQueryObjectiv(pickQueryID, GL_QUERY_RESULT, &result);
			if(result)
				printf("hitn");
			else
				printf("missn");

			isPicking = false;
		}
	modelViewMatrix.PopMatrix();
}

Mike 3.8.2012

  • Fixed the excel export issue this morning at site
  • Briefing with Jim Griffe and other this morning about the Vis Tool, preparing for Colonel Dukes demo
    • We need to prepare a slide that illustrates how to “examine the historical performance” of a project
    • A short and sweet quickstart guide for PPA would be nice as well
  • Working on a quick start guide for PPA

Phil 3.8.12

7:30 – 11:00 VISIBILITY

  • Demo prep. See Mike’s notes for more detail

11:00 – 4:00 FP

  • Now that I have the pick matrix worked out, I’m going to see how to ask the pipeline if any pixels have been drawn. Also need to see how to prevent the test drawing from going to the render buffer
  • Generating query indices and deleting them in cleanup()
  • Added a pickRender()  and pickResult() method to DrawableObject
  • Picking works, but seems to slow down the display. Also, GL_QUERY_RESULT_AVAILABLE always returns zero, even if there is a result. And just to make things a little weirder, the call glGetQueryObjectiv(drawQuery, GL_QUERY_RESULT_AVAILABLE, &result) does not slow down the display, but the following almost identical call glGetQueryObjectiv(drawQuery, GL_QUERY_RESULT, &result) does. No ideas about this right now.

 

Here’s the code in question

static enum TRANSFORM_MODE{UNAVAILABLE, HIT, MISS};
TRANSFORM_MODE pickResult(){
	GLint result;

	glGetQueryObjectiv(drawQuery, GL_QUERY_RESULT_AVAILABLE, &result);
	if(result == 0)
		return UNAVAILABLE; // always returns this

	glGetQueryObjectiv(drawQuery, GL_QUERY_RESULT, &result); // slows down rendering once called.
	if(result)
		return HIT;
	else
		return MISS;
};

Dong Shin 03.07.2012

  • prepping for demo and found some problems
    • Project Assistant Tutorial button not very button-like – fixed
    • need to take a look at ProjectAssistant.html inside to correct Flash Player download problem and eliminate auto-resize/scroll issues
    • max_allowed_packet error occurred – need to modify MySQL ini file to allow more than 1M
    • xml file creation/writing skips when max_allowed_packet error occurs. moved the code outside of the try-catch block.
  • Mavenized ResizeableControls and modified ProjectAssistant to use it instead of local reference.

Mike 3.7.2012

  • Regular morning backups
  • Imported a new visibility scripting that writes to a file instead of a servlet
  • Ran the scripts on the current PPM data and published them to the data navigator
  • Worked with Phil and Dong to create several slides for tomorrow’s predemo
  • We ran in to an error when trying to load saved views, it was resolved when I closed IE and reopened it.  We believe it has to do with trying to load a table that was created after logging in.
  • Resolved the excel export error

Phil 3.7.12

8:00 – 12:00 visibility

  • Spent the morning putting together a demo walkthrough for tomorrow. We build an ‘enhanced’ data set that would support a lot of queries and started to use it to prepare a slideshow. Got through two slides until we discovered that slides weren’t loading properly.
  • The help for Project Assistant is a bit overwhelming. There needs to be some kind of overview and quickstart.
  • There are some issues on Project Assistant that need to be worked.
    • The help on the main screen and the dialog aren’t the same, and don’t look like buttons.
    • The app does not resize when the browser window resizes. It holds onto it’s original size, regardless.
  • Data Navigator’s ‘browser tab title’ is showing up as ‘#’ again.
  • It is possible to save two desktops with identical names

12:00 – 5:30FP

  • My FB account got hacked! Had to spend some time changing passwords and telling people to ignore my ‘hi ERROR!’ message. No idea how that could have happened…
  • Got the projection matrix set up for picking. Here’s how you do it:
void Gl_ShaderWindow::setPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, GLint viewport[4])
 {
	projectionMatrix.PushMatrix();
	if (deltax <= 0 || deltay <= 0) {
 		return;
 	}
	projectionMatrix.LoadIdentity();
	/* Translate and scale the picked region to the entire window */
 	projectionMatrix.Translate((viewport[2] - 2 * (x - viewport[0])) / deltax, (viewport[3] - 2 * (y - viewport[1])) / deltay, 0);
 	projectionMatrix.Scale(viewport[2] / deltax, viewport[3] / deltay, 1.0);
	projectionMatrix.MultMatrix(viewFrustum.GetProjectionMatrix());
 }

 

Mike 3.6.2012

  • Usual Backups
  • Tried to get Colonel Dukes presentation, still no access
  • Tried to do some mandatory training from TASC I just received, can’t complete because my name is not in the system
  • Worked some more on the CASPORT production migration
  • Trying to resolve the issue of the server not being able to make HTTPS requests of iteself
  • Dong rewrote a part of VisibilityScripting to write to a file instead of a servlet which got around the issue.  I’ll deploy it tomorrow.

Phil 3.6.12

8:00 – 3:30 FP

  • Uniform Buffer Objects! Whee!
    • Urk: “Any type consuming N bytes in a buffer begins on an N byte boundary within that buffer. That means that standard GLSL types such as int, float, and bool (which are all defined to be 32-bit or four-byte quantities) begin on multiples of four bytes. A vector of these types of length two always begins on a 2N byte boundary. For example, that means a vec2, which is eight bytes long in memory, always starts on an eight-byte boundary. Three- and four-element vectors always start on a 4N byte boundary; so vec3 and vec4 types start on 16-byte boundaries. Each member of an array of scalar or vector types (ints or vec3s, for example) always start boundaries defined by these same rules, but rounded up to the alignment of a vec4. In particular, this means that arrays of anything but vec4 (and Nx4 matrices) won’t be tightly packed, but instead there will be a gap between each of the elements. Matrices are essentially treated like short arrays of vectors, and arrays of matrices are treated like very long arrays of vectors. Finally, structures and arrays of structures have additional packing requirements; the whole structure starts on the boundary required by its largest member, rounded up to the size of a vec4.
    • Need to write up a class that handles shared objects. Should be a variant on the dictionary pattern
      • DataElement class includes name, type, size, etc
      • UniformBlock class
        • Defines the name of the Uniform Block
        • Makes sure that there is room for this block, and the binding
          glGetIntegerv(GL_MAX_UNIFORM_BUFFERS)
          glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS)
        • allocates the memory
        • gets the block index
          glGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName);
        •  returns pointers to data
        • handles the writes into memory
        • bind to the shader program (I think)
          void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
  • Advanced Geometry Management (Chapter 12)
    • Queries (picking, hopefully)
      • Questions in OpenGL are represented by query objects, and much like any other object in OpenGL, query objects must be reserved, or generated. To do this, call glGenQueries, passing it the number of queries you want to reserve and the address of a variable (or array) where you would like the names of the query objects to be placed:
        void glGenQueries(GLsizei n, GLuint *ids)
        Gluint myQueries[10];
        glGenQueries(10, myQueries);
        for(int i = 0; i < 10; ++i){
            if(myQueries[i] == 0)
                // throw an error
        }
        // run queries
        glBeginQuery(GL_ANY_SAMPLES_PASSED, myQueries);
        glEndQuery(GL_ANY_SAMPLES_PASSED);
        
        // usually this should be available immediately, but be careful to handle the case if it isn't
        glGetQueryObjectuiv(myQueries[0], GL_QUERY_RESULT_AVAILABLE, &result);
        if(result == GL_TRUE)
            glGetQueryObjectuiv(myQueries[0], GL_QUERY_RESULT, &result);
        // do something based on the result
        // then when done...
        glDeleteQueries(10, myQueries); // free up space for more queries
      • So the way picking would seem to work would be to set the viewport so that it’s slightly larger than the cursor, then render bounding boxes (using glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE)) inside a loop of questions, then read back (and wait for) the results of the question. If the object is visible in the small FOV, then we can regard it as picked.
        • Setting up picking:
          	GLint viewport[4];
          	float ratio;
          
          	glSelectBuffer(BUFSIZE,selectBuf);
          
          	glGetIntegerv(GL_VIEWPORT,viewport);
          
          	glRenderMode(GL_SELECT);
          
          	glInitNames();
          
          	glMatrixMode(GL_PROJECTION);
          	glPushMatrix();
          	glLoadIdentity();
          
          	gluPickMatrix(cursorX,viewport[3]-cursorY,5,5,viewport);
          	ratio = (viewport[2]+0.0) / viewport[3];
          	gluPerspective(45,ratio,0.1,1000);
          	glMatrixMode(GL_MODELVIEW);
        • The source for gluPerspective() is here
      • Another way of doing picking – http://www.gpucomputing.net/sites/default/files/110606_picking_1.pdf

Mike 3.5.2012

  • Scanned in new test versions of the various visibility parts.
  • The AccountManagers I moved to PPM and compiled last Friday worked!
  • Also, modifying all the compiler settings to match those of PPM worked as well.
  • Usual backups this morning.
  • Answered several emails concerning stuff like “what is visibility?”
  • Resolved the IAVA patch errors
  • Attempted to locate the ISR PMO presentation from last week, apparently it is in a folder i don’t have permission to view
  • Rebuilt visibility, account managers, and ingest manager with the new compiler settings, will deploy tomorrow
  • Went back to site and deployed the rebuilt applications.  Everything works except for one small thing:
    • VisibilityScripting publishes an xml file on the server.  IngestManager can then import that file in to the Visibility database.  However with the current server set up, the validate URL fails.  I’m guessing because of certificate errors.