https://wiki.cdot.senecacollege.ca/w/api.php?action=feedcontributions&user=Gbatumbya&feedformat=atomCDOT Wiki - User contributions [en]2024-03-28T20:36:33ZUser contributionsMediaWiki 1.30.0https://wiki.cdot.senecacollege.ca/w/index.php?title=User:Gbatumbya&diff=89868User:Gbatumbya2012-10-16T20:02:02Z<p>Gbatumbya: </p>
<hr />
<div>[[category: gbatumbya]]<br />
=About Me=<br />
<br />
[[Image:Gbatumbya_AboutMe.png|thumb|100px|About Me]]Name: '''Grace Simon Batumbya'''<br />
<br/>Program: '''Bachelor of Software Development'''<br />
<br/>Blog: [http://gbatumbya.wordpress.com gbatumbya.wordpress.com]<br />
<br/>IRC nick: '''bgrace'''<br />
<br/><strike>email: Grace [dot] Batumbya [at] senecac.on.ca</strike><br />
<br/>email: G [dot] Batumbya [at] outlook.com<br />
<br />
<br />
=Projects=<br />
[[NexJ_Express | NexJ Express Projects]]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter&diff=86087SQLite Adapter2012-08-02T14:29:47Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ_Past_Projects]]<br />
<!--[[category: NexJ Current Projects]]--><br />
[[category: NexJ Express SQLite]]<br />
<br />
<big><big> SQLite Adapter for NexJ </big></big><br />
<br />
<br />
== Project Goal ==<br />
Develop an adapter to enable NexJ Express's model interaction with SQLite databases.<br />
<!--<br />
=== Software Design Document ===<br />
[https://docs.google.com/document/d/1aX9YqdXcABKmxegTcovyZXqWYp_9NnPmke6QU8jfiBU/edit?hl=en_US Read only]<br />
--><br />
<br />
<br />
=== Contributors ===<br />
* [[User:Cwdesautels|Carl Desautels]]<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Abhishekbh|Abhishek Bhatnagar]]<br />
* [[User:Wei.song | Wei Song]]<br />
<br />
=== Supported Versions ===<br />
* sqlite.3.7.10 <br />
** Compiled with the following flags:<br />
***SQLITE_ENABLE_LOAD_EXTENSION=1<br />
***SQLITE_ENABLE_UPDATE_DELETE_LIMIT<br />
***SQLITE_ENABLE_COLUMN_METADATA<br />
***SQLITE_CORE<br />
***SQLITE_ENABLE_FTS4<br />
***SQLITE_ENABLE_FTS3_PARENTHESIS<br />
***SQLITE_ENABLE_RTREE<br />
***SQLITE_ENABLE_STAT3<br />
***SQLITE_SOUNDEX=1<br />
***SQLITE_MAX_VARIABLE_NUMBER=4000<br />
***SQLITE_USE_URI<br />
***SQLITE_ENABLE_ICU<br />
***SQLITE_DEFAULT_FOREIGN_KEYS=1<br />
***DSQLITE_THREADSAFE=1<br />
<br />
== Project Status==<br />
* '''Current Sprint''' : Code Review 1<br />
<br />
* [[SQLite_Adapter_StandUp_Reports | Stand Up Reports]]<br />
<br />
== Project Backlog ==<br />
=== Investigation (DONE) ===<br />
* Research SQLite / JDBC driver<br />
* Get requirements from NexJ (Meeting Friday Sept 23rd)<br />
* [[SQLite_Adapter_Research | Research Summary]]<br />
<br />
<br />
=== Sprint: 1 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
|Initial skeleton of the SQLite adapter<br />
|2<br />
|Running the jUnit test shows in the console that the adapter is loaded an running.<br />
|-<br />
|Use database schema tool to generate the SQL to setup the database<br />
|1<br />
|Running the DB Schema Tool's "setup" command, appropriate artifacts are created (e.g. sql or bat script) for generating the SQLite database.<br />
|-<br />
|Use database schema tool to generate the SQL to create the Core datasource's tables<br />
|5<br />
|Running the DB Schema Tool's "create" command, appropriate artifacts are created (e.g. a sql file) for creating the tables in an existing SQLite database.<br />
|}<br />
<br />
<br />
=== Sprint 2 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Use data schema tool to generate the SQL to insert the data from a dump file<br />
| 0<br />
| Running the DB schema Tool's 'insert' command, appropriate artifacts are created in the database<br />
|-<br />
| Use the scheme console to insert into and read from the database<br />
| 0<br />
| Running the schema console, perform multi-transactional inserts with commits and rollbacks. Reading from the database to confirm updates<br />
|-<br />
| Use the data load tool to extract information in a SQLite database and persist it to a dump file<br />
| 0<br />
| Running the data load tool, read information from the database and export it to a dump file<br />
|-<br />
| Use the database schema tool to create an insert script for all the instances in in a SQLite database<br />
| 0<br />
| Running the data load tool, read in information from a dump file<br />
|-<br />
| Add an attribute to the User class, add the column to the datasource and Main.upgrade. Use the data load tool to upgrade the SQLite database. The database now has the new column add to the User Table<br />
| 3<br />
| Running the database schema tool alter the user class and perform an upgrade<br />
|-<br />
| Run each of the data load tool commands to validate their use<br />
| 5<br />
| Running all of the data load tool's commands, checking for expected results<br />
|-<br />
| Run each of the database schema tool commands to validate their use<br />
| 5<br />
| Running all of the database schema tools commands, checking for expected results<br />
|}<br />
<br />
<br />
=== Sprint 3 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Retrieve a record using fulltext search in the where clause<br />
| 0<br />
| Using the SQlite Adapter perform a query to verify the full test search options have been configured properly<br />
|-<br />
| Demonstrate unicode support in sqlite functions<br />
| 5<br />
| Using the SQlite Adapter perform a query to verify unicode support is as expected in sqlite functions<br />
|-<br />
| Run all SQLiteSchemaManager unit tests, to validate correctness<br />
| 2<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|-<br />
| Run all the SQLiteAdapter unit tests, to validate correctness<br />
| 7<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|}<br />
<br />
<br />
== Project Repository ==<br />
* Central: https://bitbucket.org/cwdesautels/nexj-express-sqlite-adapter<br />
<br />
<br />
== Building JDBC from source ==<br />
* [[SQLite_Xerial_JDBC_From_Source | HowTo]] <br />
<br />
<br />
== Resources ==<br />
* Dowloads:<br />
** http://www.sqlite.org/download.html<br />
* Documentation:<br />
** Root - http://www.sqlite.org/docs.html<br />
** About - http://www.sqlite.org/about.html<br />
** Types - http://www.sqlite.org/datatype3.html<br />
** Limits - http://www.sqlite.org/limits.html<br />
** Null Handling - http://www.sqlite.org/nulls.html<br />
** Omitted Features - http://www.sqlite.org/omitted.html<br />
** SQL to SQLite - http://www.sqlite.org/lang_expr.html<br />
** API - http://www.sqlite.org/c3ref/intro.html<br />
* QuickStart:<br />
** Usage - http://www.sqlite.org/cintro.html<br />
** C Interface - http://www.sqlite.org/cintro.html<br />
* SQLite JDBC Driver:<br />
** (Unoffical) http://www.xerial.org/trac/Xerial</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=NexJ_Express&diff=86023NexJ Express2012-07-19T20:57:13Z<p>Gbatumbya: </p>
<hr />
<div>{{NexJ_Express Index}}<br />
<br />
{|border="0" cellspacing="0" cellpadding="0" style="padding:0px; margin:0px;" |<br />
|-<br />
| colspan="3" valign="top" |<br />
{{Robelbox|theme=13|title=Introduction}}<br />
<div style="{{Robelbox/pad}}"><br />
NexJ Model Server Express is an open source [http://java.sun.com/javaee/ Java EE-based] execution server specialized to enterprise integration applications. It provides services for deploying highly scalable, fault-tolerant, distributed enterprise solutions. NexJ Model Server Express provides:<br />
<br />
<br />
* Business Object Engine - supports a single-inheritance class structure as well as aspects to provide specific application characteristics<br />
* Workflow Engine - persistent, long-running asynchronous UML activities that are initiated by and act on business class instances<br />
* Persistence Engine - connect your model to multiple data sources (relational, XML file) in a database-independent way. Connect to multiple data sources at runtime leveraging different database adapters<br />
* Integration Engine - model message-based communication between the running model and other systems. The engine supports multiple protocols and message formats<br />
* Security Engine - design a privilege-based security model and apply it throughout the other model layers<br />
<br />
<br />
<br />
NexJ's approach to model-driven engineering (MDE), support by the model-execution capabilities of NexJ Model Server Express, greatly simplifies the process of developing enterprise applications. Using NexJ Express Studio, developers focus on solving the business problems while the NexJ Framework handles technical complexities of running that solution.<br />
</div><br />
<div style="border-top:1px solid #8488DC; border-bottom:1px solid #8488DC; background-color:#CED1FA; padding:0.2em 0.9em 0.2em 0.5em; font-size:110%;">Industry Partnership<br />
</div><br />
<div style="height:10px"> </div><!--spacer--><br />
<div style="{{Robelbox/pad}}"><br />
[[Image:Nexj-logo.jpg|right|122px]][http://cdot.senecac.on.ca Seneca CDOT] in partnership with [http://www.nexj.com NexJ Systems] (a leading provider of enterprise private cloud software, delivering enterprise customer relationship management (CRM) solutions to the financial services, insurance, and healthcare industries) work to both add and enhance existing functionality to NexJ Express. NexJ Express is part of [http://www.openhealthtools.org Open Health Tools(OHT)] serving as the [http://tinyurl.com/oht-aip Application Intergration Platfrom(AIP)]<br />
<br />
</div><br />
{{Robelbox/close}}<br />
<br/><br />
|-<br />
| colspan="3" valign="top" |<br />
{{Robelbox | theme=12|title=Contributors}}<br />
<div style="{{Robelbox/pad}}"><br />
Faculty<br />
* [[User:JAnastasiade| Jordan Anastasiade]]<br />
* [[User:Pliu | Peter Liu]]<br />
<br />
<br />
Current Research Assistants<br />
* [[User:Cwdesautels | Carl Desautels]]<br />
* [[User:Wei.song | Wei Song]]<br />
<br />
<br />
Past Research Assistants<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[Minooz/Projects | Minoo Ziaei]]<br />
* [[User:AnastasiaS | Anastasia Semionova]]<br />
* [[Tung-NexJ-Page | Tung Pui Cheung]]<br />
* [[User:Brianlim | Brian Lim]]<br />
* [[User:Abhishekbh | Abhishek Bhatnagar]]<br />
<br />
<br />
</div><br />
{{Robelbox/close}}<br />
<br/><br />
|-<br />
| width=33% valign=top |<br />
{{Robelbox|theme=1|title=[[:Category:NexJ Current Projects|Current Projects]]}}<br />
<div style="{{Robelbox/pad}};height:300px; overflow:auto;"><br />
Below is a list of projects that CDOT is actively contributing to<br />
<categorytree mode=all hideroot=on>NexJ Current Projects</categorytree><br />
</div><br />
{{Robelbox/close}}<br />
| width=33% valign=top |<br />
{{Robelbox|theme=1|title=[[:Category:NexJ Past Projects|Completed Projects]]}}<br />
<div style="{{Robelbox/pad}};height:300px; overflow:auto;"><br />
Below is a list of projects that CDOT has successfully completed<br />
<categorytree mode=all hideroot=on>NexJ Past Projects</categorytree><br />
</div><br />
{{Robelbox/close}}<br />
|} <br />
<br />
<!--<br />
= Human Resources=<br />
<br />
December 10, 2010 <br />
<br />
[[Image:Grace-Peter-Minoo-Dec10-10.jpg| Grace, Peter, Minoo | 800px]]<br />
::Minoo, Peter, Grace (from left to right)<br />
<br />
[[Image:Minoo-Jordan-Grace-Dec10-10.jpg| Grace, Peter, Minoo | 800px]]<br />
::Minoo, Jordan, Grace<br />
<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=CDOT_Staff&diff=85560CDOT Staff2012-06-06T18:29:45Z<p>Gbatumbya: </p>
<hr />
<div>[[Category:CDOT Staff]]People working in the CDOT area, including CDOT researchers and faculty, ORI staff, and Industry Partners:<br />
<br />
{|cellspacing="0" cellpadding="3" border="1" class="sortable"<br />
!First Name<br />
!Last Name<br />
!Seneca LDAP ID<br />
!Wiki Name<br />
!IRC, Twitter Nicks<br />
!Blog<br />
!Extension<br />
!Primary Project<br />
!Role (Researcher, Faculty, Support, Administration, Industry Partner)<br />
|-<br />
|Andor||Salga||andor.salga||[[User:asalga |asalga ]]||asalga||http://asalga.wordpress.com||-||WebGL||Researcher<br />
|-<br />
|Anthony||Boccia||anthony.boccia||[[User:Aeboccia|Aeboccia]]||aeboccia||http://opensourceftw.blogspot.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Ben||Kam||ben.kam|| || || || || ||Faculty<br />
|-<br />
|Bhatnagar||Abhishek||-||[[User:abhishekbh|abhishekbh]]||abhatnag, @abhishekToronto||http://brattahlid.wordpress.com/||-||[[NexJ Express]]||Researcher<br />
|-<br />
|Brian||Lim||None Yet||[[User:Brianlim|Brianlim]]||brian_lim||http://brianlim.ca/||-||[[NexJ Express]]||Researcher<br />
|-<br />
|Carl||Desautels ||carlin.desautels||[[User:cwdesautels|cwdesautels]]||cdes_, [http://twitter.com/cwdesautels @cwdesautels]||http://cwd89.blogspot.com/||-||[[NexJ Express]], [[BerrySync]]||Researcher<br />
|-<br />
|Catherine||Leung||catherine.leung||[[User:catherine.leung|catherine.leung ]]||cathy cathyatseneca||http://cleung.wordpress.com||3348||WebGL||Faculty<br />
|-<br />
|Chad||Pilkey||chad.pilkey||[[User:chad.pilkey|chad.pilkey ]]||capilkey||http://chadpilkey.wordpress.com||-||BigBlueButton||Researcher<br />
|-<br />
|Christopher||De Cairos||cadecairos||[[User:Cadecairos|Christopher De Cairos]]||cadecairos||http://www.chrisdecairos.ca||-||Popcorn && Popcorn Maker ||Researcher<br />
|-<br />
|Chris||Tyler||chris.tyler||[[User:Chris Tyler|Chris Tyler]]||ctyler, [http://twitter.com/#!/chris_tyler @chris_tyler]||http://blog.chris.tylers.info/||3315||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Faculty<br />
|-<br />
|Daniel||Hodgin||daniel.hodgin||[[User:Dhhodgin|Dhhodgin]]||dhodgin, [http://twitter.com/dhodgin @dhodgin]||http://hodgin.ca||3380||Processing.js, JavaScript Libraries||Researcher<br />
|-<br />
|David||Humphrey||david.humphrey||[[User:David.humphrey|David.humphrey]]||humph, [http://twitter.com/humphd @humphd]||http://vocamus.net/dave||3263||Mozilla, JavaScript Libraries||Faculty<br />
|-<br />
|David||Perit||-||[[User:dperit |dperit ]]||dperit, [http://twitter.com/dperit @dperit]||http://dperit.blogspot.com/||-||WebGL||Researcher<br />
|-<br />
|David||Seifried|| dseifried ||[[User:dseifried|dseifried]] || dseif [http://twitter.com/#!/dcseifried @dcseifried] ||http://dseifried.wordpress.com ||- ||JavaScript Libraries ||Researcher<br />
|-<br />
|Dawn||Mercer||dawn.mercer||[[User:Dawn Mercer|dawn.mercer]] || || ||x3086||Interaction Design, User testing ||Researcher, Admin<br />
|-<br />
|Donna||Oberes|| || || || || || ||Researcher<br />
|-<br />
|Evan||Weaver || || || || || || ||Admin, Project Lead<br />
|-<br />
|Grace Simon||Batumbya||grace.batumbya||[[User:gbatumbya|gbatumbya]]||bgrace||http://gbatumbya.wordpress.com||3548||[[NexJ Express]]||Researcher<br />
|-<br />
|Fardad||Soleimanloo || || || || || || ||Faculty<br />
|-<br />
|Jonathan||Chiappetta||jon.chiappetta||[[User:Fossjon|Fossjon]]||fossjon||http://fossjon.wordpress.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Jon||Buckley||jon.buckley||[[User:jbuck|jbuck]]||jbuck||http://jbuckley.ca||3380||Javascript Libraries||Researcher<br />
|-<br />
|Jordan||Anastasiade||jordan.anastasiade||[[User:JAnastasiade|Jordan.Anastasiade]]||_jordan||-||3261||[[NexJ Express]], Eclipse, Java EE, Mobile||Faculty<br />
|-<br />
|Justin||Robinson||justin.robinson||[[User:JTRobinson|Justin.Robinson]]||justinrobinson||[http://justintrobinson.wordpress.com/ do {blog();} while (j == awesome);]||33380||BigBlueButton||Researcher<br />
|-<br />
|Kaitlyn||Callow ||dacallow||[[User:dacallow|dacallow]]||kait85||http://www.kaitlyncallow.com/Blog||-||[http://zenit.senecac.on.ca/wiki/index.php/BerrySync BerrySync]||Researcher<br />
|-<br />
|Masihul||Abed||masihul.abed||[[User:maxamaxim|M Abed]]||[http://twitter.com/#!/maxamaxim @maxamaxim]||[http://maxamaxim.wordpress.com Max's Blog]||||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Mao Hua||Li ||-||[[User:Maoli1207|Maoli1207]]||Mao ||http://maoli1207.blogspot.com/||-||[http://zenit.senecac.on.ca/wiki/index.php/BerrySync BerrySync]||Researcher<br />
|-<br />
|Mike||Hoye ||-||[[User:mhoye|mhoye]]||mhoye||http://exple.tive.org/blarg||-||[http://zenit.senecac.on.ca/wiki/index.php/BerrySync BerrySync]||Industry Partner<br />
|-<br />
|Mohammed||Buttu|| || || || || || ||Researcher<br />
|-<br />
|Paul||Whalen||paul.whalen||[[User:Paul.W|Paul.W]]||PaulW PaulW_cdot||http://paulfedora.wordpress.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Peter||Callaghan ||peter.callaghan||[[pcallaghan]]||pcallaghan|||||||C3DL||Faculty/Researcher<br />
|-<br />
|Peter||Liu ||peter.liu||[[User:Pliu|Peter Liu]]||pliu||http://pliu.wordpress.com/||3234||[[NexJ Express]]||Faculty<br />
|-<br />
|Salman||Zafar||salman.zafar||[[User:szafar8|szafar8]]||szafar8||http://szafar8.wordpress.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Scott||Downe||scott.downe||[[User:sdowne|sdowne]]||scott/sdowne, [http://twitter.com/#!/scottdowne @scottdowne]||http://scottdowne.wordpress.com/||-||JavaScript Libraries||Researcher<br />
|-<br />
|Wei||Song||wei.song||[[User:wei.song|wei.song]]||WeiS||http://wsong18.blogspot.com/||-||[[NexJ Express]]||Researcher<br />
|-<br />
|}<br />
<br />
<br />
Notes:<br />
* The LDAP ID should be your staff LDAP ID, not your student LDAP ID (if applicable). Generally, these are in the form ''firstname.lastname''<br />
* The LDAP ID can be converted to an e-mail address with the appropriate transformation :-)</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=CDOT_Staff&diff=85559CDOT Staff2012-06-06T18:29:18Z<p>Gbatumbya: </p>
<hr />
<div>[[Category:CDOT Staff]]People working in the CDOT area, including CDOT researchers and faculty, ORI staff, and Industry Partners:<br />
<br />
{|cellspacing="0" cellpadding="3" border="1" class="sortable"<br />
!First Name<br />
!Last Name<br />
!Seneca LDAP ID<br />
!Wiki Name<br />
!IRC, Twitter Nicks<br />
!Blog<br />
!Extension<br />
!Primary Project<br />
!Role (Researcher, Faculty, Support, Administration, Industry Partner)<br />
|-<br />
|Andor||Salga||andor.salga||[[User:asalga |asalga ]]||asalga||http://asalga.wordpress.com||-||WebGL||Researcher<br />
|-<br />
|Anthony||Boccia||anthony.boccia||[[User:Aeboccia|Aeboccia]]||aeboccia||http://opensourceftw.blogspot.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Ben||Kam||ben.kam|| || || || || ||Faculty<br />
|-<br />
|Bhatnagar||Abhishek||-||[[User:abhishekbh|abhishekbh]]||abhatnag, @abhishekToronto||http://brattahlid.wordpress.com/||-||[[NexJ Express]]||Researcher<br />
|-<br />
|Brian||Lim||None Yet||[[User:Brianlim|Brianlim]]||brian_lim||http://brianlim.ca/||-||[[NexJ Express]]||Researcher<br />
|-<br />
|Carl||Desautels ||carlin.desautels||[[User:cwdesautels|cwdesautels]]||cdes_, [http://twitter.com/cwdesautels @cwdesautels]||http://cwd89.blogspot.com/||-||[[NexJ Express]], [[BerrySync]]||Researcher<br />
|-<br />
|Catherine||Leung||catherine.leung||[[User:catherine.leung|catherine.leung ]]||cathy cathyatseneca||http://cleung.wordpress.com||3348||WebGL||Faculty<br />
|-<br />
|Chad||Pilkey||chad.pilkey||[[User:chad.pilkey|chad.pilkey ]]||capilkey||http://chadpilkey.wordpress.com||-||BigBlueButton||Researcher<br />
|-<br />
|Christopher||De Cairos||cadecairos||[[User:Cadecairos|Christopher De Cairos]]||cadecairos||http://www.chrisdecairos.ca||-||Popcorn && Popcorn Maker ||Researcher<br />
|-<br />
|Chris||Tyler||chris.tyler||[[User:Chris Tyler|Chris Tyler]]||ctyler, [http://twitter.com/#!/chris_tyler @chris_tyler]||http://blog.chris.tylers.info/||3315||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Faculty<br />
|-<br />
|Daniel||Hodgin||daniel.hodgin||[[User:Dhhodgin|Dhhodgin]]||dhodgin, [http://twitter.com/dhodgin @dhodgin]||http://hodgin.ca||3380||Processing.js, JavaScript Libraries||Researcher<br />
|-<br />
|David||Humphrey||david.humphrey||[[User:David.humphrey|David.humphrey]]||humph, [http://twitter.com/humphd @humphd]||http://vocamus.net/dave||3263||Mozilla, JavaScript Libraries||Faculty<br />
|-<br />
|David||Perit||-||[[User:dperit |dperit ]]||dperit, [http://twitter.com/dperit @dperit]||http://dperit.blogspot.com/||-||WebGL||Researcher<br />
|-<br />
|David||Seifried|| dseifried ||[[User:dseifried|dseifried]] || dseif [http://twitter.com/#!/dcseifried @dcseifried] ||http://dseifried.wordpress.com ||- ||JavaScript Libraries ||Researcher<br />
|-<br />
|Dawn||Mercer||dawn.mercer||[[User:Dawn Mercer|dawn.mercer]] || || ||x3086||Interaction Design, User testing ||Researcher, Admin<br />
|-<br />
|Donna||Oberes|| || || || || || ||Researcher<br />
|-<br />
|Evan||Weaver || || || || || || ||Admin, Project Lead<br />
|-<br />
|Grace Simon||Batumbya||grace.batumbya||[[User:gbatumbya|gbatumbya]]||bgrace||http://gbatumbya.wordpress.com||3548||[[NexJ Express]]||Researcher<br />
|-<br />
|Fardad||Soleimanloo || || || || || || ||Faculty<br />
|-<br />
|Jonathan||Chiappetta||jon.chiappetta||[[User:Fossjon|Fossjon]]||fossjon||http://fossjon.wordpress.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Jon||Buckley||jon.buckley||[[User:jbuck|jbuck]]||jbuck||http://jbuckley.ca||3380||Javascript Libraries||Researcher<br />
|-<br />
|Jordan||Anastasiade||jordan.anastasiade||[[User:JAnastasiade|Jordan.Anastasiade]]||_jordan||-||3261||[[NexJ Express]], Eclipse, Java EE, Mobile||Faculty<br />
|-<br />
|Justin||Robinson||justin.robinson||[[User:JTRobinson|Justin.Robinson]]||justinrobinson||[http://justintrobinson.wordpress.com/ do {blog();} while (j == awesome);]||33380||BigBlueButton||Researcher<br />
|-<br />
|Kaitlyn||Callow ||dacallow||[[User:dacallow|dacallow]]||kait85||http://www.kaitlyncallow.com/Blog||-||[http://zenit.senecac.on.ca/wiki/index.php/BerrySync BerrySync]||Researcher<br />
|-<br />
|Masihul||Abed||masihul.abed||[[User:maxamaxim|M Abed]]||[http://twitter.com/#!/maxamaxim @maxamaxim]||[http://maxamaxim.wordpress.com Max's Blog]||||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Mao Hua||Li ||-||[[User:Maoli1207|Maoli1207]]||Mao ||http://maoli1207.blogspot.com/||-||[http://zenit.senecac.on.ca/wiki/index.php/BerrySync BerrySync]||Researcher<br />
|-<br />
|Mike||Hoye ||-||[[User:mhoye|mhoye]]||mhoye||http://exple.tive.org/blarg||-||[http://zenit.senecac.on.ca/wiki/index.php/BerrySync BerrySync]||Industry Partner<br />
|-<br />
|Mohammed||Buttu|| || || || || || ||Researcher<br />
|-<br />
|Paul||Whalen||paul.whalen||[[User:Paul.W|Paul.W]]||PaulW PaulW_cdot||http://paulfedora.wordpress.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Peter||Callaghan ||peter.callaghan||[[pcallaghan]]||pcallaghan|||||||C3DL||Faculty/Researcher<br />
|-<br />
|Peter||Liu ||peter.liu||[[User:Pliu|Peter Liu]]||pliu||http://pliu.wordpress.com/||3234||NexJ Express||Faculty<br />
|-<br />
|Salman||Zafar||salman.zafar||[[User:szafar8|szafar8]]||szafar8||http://szafar8.wordpress.com/||3463||[http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture Fedora-ARM]||Researcher<br />
|-<br />
|Scott||Downe||scott.downe||[[User:sdowne|sdowne]]||scott/sdowne, [http://twitter.com/#!/scottdowne @scottdowne]||http://scottdowne.wordpress.com/||-||JavaScript Libraries||Researcher<br />
|-<br />
|Wei||Song||wei.song||[[User:wei.song|wei.song]]||WeiS||http://wsong18.blogspot.com/||-||[[NexJ Express]]||Researcher<br />
|-<br />
|}<br />
<br />
<br />
Notes:<br />
* The LDAP ID should be your staff LDAP ID, not your student LDAP ID (if applicable). Generally, these are in the form ''firstname.lastname''<br />
* The LDAP ID can be converted to an e-mail address with the appropriate transformation :-)</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter&diff=85035SQLite Adapter2012-05-08T18:14:53Z<p>Gbatumbya: /* Project Status */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express SQLite]]<br />
<br />
<big><big> SQLite Adapter for NexJ </big></big><br />
<br />
<br />
== Project Goal ==<br />
Develop an adapter to enable NexJ Express's model interaction with SQLite databases.<br />
<!--<br />
=== Software Design Document ===<br />
[https://docs.google.com/document/d/1aX9YqdXcABKmxegTcovyZXqWYp_9NnPmke6QU8jfiBU/edit?hl=en_US Read only]<br />
--><br />
<br />
<br />
=== Contributors ===<br />
* [[User:Cwdesautels|Carl Desautels]]<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Abhishekbh|Abhishek Bhatnagar]]<br />
* [[User:Wei.song | Wei Song]]<br />
<br />
=== Supported Versions ===<br />
* sqlite.3.7.10 <br />
** Compiled with the following flags:<br />
***SQLITE_ENABLE_LOAD_EXTENSION=1<br />
***SQLITE_ENABLE_UPDATE_DELETE_LIMIT<br />
***SQLITE_ENABLE_COLUMN_METADATA<br />
***SQLITE_CORE<br />
***SQLITE_ENABLE_FTS4<br />
***SQLITE_ENABLE_FTS3_PARENTHESIS<br />
***SQLITE_ENABLE_RTREE<br />
***SQLITE_ENABLE_STAT3<br />
***SQLITE_SOUNDEX=1<br />
***SQLITE_MAX_VARIABLE_NUMBER=4000<br />
***SQLITE_USE_URI<br />
***SQLITE_ENABLE_ICU<br />
***SQLITE_DEFAULT_FOREIGN_KEYS=1<br />
***DSQLITE_THREADSAFE=1<br />
<br />
== Project Status==<br />
* '''Current Sprint''' : Code Review 1<br />
<br />
* [[SQLite_Adapter_StandUp_Reports | Stand Up Reports]]<br />
<br />
== Project Backlog ==<br />
=== Investigation (DONE) ===<br />
* Research SQLite / JDBC driver<br />
* Get requirements from NexJ (Meeting Friday Sept 23rd)<br />
* [[SQLite_Adapter_Research | Research Summary]]<br />
<br />
<br />
=== Sprint: 1 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
|Initial skeleton of the SQLite adapter<br />
|2<br />
|Running the jUnit test shows in the console that the adapter is loaded an running.<br />
|-<br />
|Use database schema tool to generate the SQL to setup the database<br />
|1<br />
|Running the DB Schema Tool's "setup" command, appropriate artifacts are created (e.g. sql or bat script) for generating the SQLite database.<br />
|-<br />
|Use database schema tool to generate the SQL to create the Core datasource's tables<br />
|5<br />
|Running the DB Schema Tool's "create" command, appropriate artifacts are created (e.g. a sql file) for creating the tables in an existing SQLite database.<br />
|}<br />
<br />
<br />
=== Sprint 2 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Use data schema tool to generate the SQL to insert the data from a dump file<br />
| 0<br />
| Running the DB schema Tool's 'insert' command, appropriate artifacts are created in the database<br />
|-<br />
| Use the scheme console to insert into and read from the database<br />
| 0<br />
| Running the schema console, perform multi-transactional inserts with commits and rollbacks. Reading from the database to confirm updates<br />
|-<br />
| Use the data load tool to extract information in a SQLite database and persist it to a dump file<br />
| 0<br />
| Running the data load tool, read information from the database and export it to a dump file<br />
|-<br />
| Use the database schema tool to create an insert script for all the instances in in a SQLite database<br />
| 0<br />
| Running the data load tool, read in information from a dump file<br />
|-<br />
| Add an attribute to the User class, add the column to the datasource and Main.upgrade. Use the data load tool to upgrade the SQLite database. The database now has the new column add to the User Table<br />
| 3<br />
| Running the database schema tool alter the user class and perform an upgrade<br />
|-<br />
| Run each of the data load tool commands to validate their use<br />
| 5<br />
| Running all of the data load tool's commands, checking for expected results<br />
|-<br />
| Run each of the database schema tool commands to validate their use<br />
| 5<br />
| Running all of the database schema tools commands, checking for expected results<br />
|}<br />
<br />
<br />
=== Sprint 3 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Retrieve a record using fulltext search in the where clause<br />
| 0<br />
| Using the SQlite Adapter perform a query to verify the full test search options have been configured properly<br />
|-<br />
| Demonstrate unicode support in sqlite functions<br />
| 5<br />
| Using the SQlite Adapter perform a query to verify unicode support is as expected in sqlite functions<br />
|-<br />
| Run all SQLiteSchemaManager unit tests, to validate correctness<br />
| 2<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|-<br />
| Run all the SQLiteAdapter unit tests, to validate correctness<br />
| 7<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|}<br />
<br />
<br />
== Project Repository ==<br />
* Central: https://bitbucket.org/cwdesautels/nexj-express-sqlite-adapter<br />
<br />
<br />
== Building JDBC from source ==<br />
* [[SQLite_Xerial_JDBC_From_Source | HowTo]] <br />
<br />
<br />
== Resources ==<br />
* Dowloads:<br />
** http://www.sqlite.org/download.html<br />
* Documentation:<br />
** Root - http://www.sqlite.org/docs.html<br />
** About - http://www.sqlite.org/about.html<br />
** Types - http://www.sqlite.org/datatype3.html<br />
** Limits - http://www.sqlite.org/limits.html<br />
** Null Handling - http://www.sqlite.org/nulls.html<br />
** Omitted Features - http://www.sqlite.org/omitted.html<br />
** SQL to SQLite - http://www.sqlite.org/lang_expr.html<br />
** API - http://www.sqlite.org/c3ref/intro.html<br />
* QuickStart:<br />
** Usage - http://www.sqlite.org/cintro.html<br />
** C Interface - http://www.sqlite.org/cintro.html<br />
* SQLite JDBC Driver:<br />
** (Unoffical) http://www.xerial.org/trac/Xerial</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=CDOT_Development_Systems&diff=84810CDOT Development Systems2012-05-01T20:35:27Z<p>Gbatumbya: /* Machine names, IPs, and Status */</p>
<hr />
<div>[[Category:CDOT]]These machines are in the CDOT area on the first floor of the TEL building.<br />
<br />
= Ground Rules =<br />
<br />
# Take responsibility for your actions.<br />
# Don't blow up other people's stuff.<br />
# Expect other people to blow up your stuff.<br />
# Don't turn these machines off.<br />
# Before rebooting, check with the other logged-in users, and check on #seneca on IRC on both Freenode and Moznet.<br />
# Work under your own account, using root as sparingly as possible. If you need additional accounts, create them, but put your name in the comment (GCOS) field.<br />
# Don't create public services.<br />
# '''These machines are never backed up. Backup your own stuff, frequently.'''<br />
<br />
= IP Information =<br />
<br />
See http://scotland.proximity.on.ca/cdot/network/<br />
<br />
= Disk Space =<br />
<br />
Keep an eye on disk space -- both your own usage and the free space on the machine. Delete stuff you don't need (especially temp files and build debris).<br />
<br />
Most of the CDOT machines have unassigned storage within their volume group. If you need additional space in a filesystem and know how to use LVM safely, feel free to allocate additional space as needed, but do not assign more space than required for your work (it's easier to add space to a filesystem than to remove it to add it to another filesystem). '''If you do not know how to administer LVM safely, ask an experienced user to add space to the filesystem for you -- it's very easy to destroy a filesystem.''' Please experiment with and learn about LVM on your own systems or in a virtual machine.<br />
<br />
= Virtual Machines =<br />
<br />
Please feel free to configure KVM virtual machines on the PCs. Because virtualization technologies conflict, please discuss the use of other hypervisors before deploying them.<br />
<br />
When using virtual machines, please:<br />
* Shutdown the VM when not in use<br />
<br />
<!-- = Connectivity Status =<br />
<br />
The connectivity of the systems is tested every 5 minutes using ICMP echo (ping) and may be viewed on the [http://liberia.cdot.proximity.on.ca/uptime/ CDOT Development System Status] page.<br />
<br />
######### Disabled 2010-05-03 - Liberia's installation has disabled the connectivity status display. ############<br />
<br />
--><br />
<br />
= Machine names, IPs, and Status =<br />
<br />
Please update this information as you work on the machines' configuration.<br /><br />
'''Click on a machine name to go to the page for that system. Please record details on that page about how the system is being used. A sample machine pages is located at [[CDOT_Development_Systems/ExampleSystem]]'''<br />
<br />
{|border="1" width="100%" class="mediawiki sortable"<br />
|-<br />
!Hostname<br />
!Type<br />
!Location<br />
!IP<br />
!OS<br />
!Notes<br />
!Monitor(s)<br />
!Disk<br />
!RAM<br />
!Video<br />
!Motherboard<br />
!CPU<br />
<br />
|-<br />
|[[CDOT Development Systems/iraq|iraq]]<br />
|PC - Quad i7<br />
|T1045C<br />
|142.204.133.80<br />
|F16<br />
|<br />
|Dual LCD<br />
|2x2TB<br />
|12G<br />
|Nvidia - dual monitors<br />
|<br />
|930 (Quad i7 2.8GHz)<br />
<br />
|-<br />
|[[CDOT Development Systems/romania|romania]]<br />
|PC - Quad i7<br />
|T1045<br />
|142.204.133.82<br />
|F16<br />
|<br />
|Dual LCD<br />
|2x2TB<br />
|12G<br />
|Nvidia - dual monitors<br />
|<br />
|930 (Quad i7 2.8GHz)<br />
<br />
|-<br />
|[[CDOT_Development_Systems/germany|germany]]<br />
|PC - Quad Core, 8GB, 1TB<br />
|T1045C<br />
|142.204.133.24<br />
|Fedora 10 32-bit<br />
|<br />
|DELL 4001<br />
|1TB<br />
|8GB - 4 banks<br />
|Intel<br />
|Intel DQ45CB<br />
|Intel Q6600<br />
<br />
|-<br />
|[[CDOT_Development_Systems/india|india]]<br />
|PC - Quad Core, 8GB, 1TB<br />
|T1045B<br />
|142.204.133.28<br />
|F12<br /><br />
|<br />
|Viewsonic VA2226w (VSC 2051)<br />
|1TB<br />
|8GB - 4 banks<br />
|Intel<br />
|Intel DQ45CB<br />
|Intel Q6600<br />
<br />
|-<br />
|[[CDOT_Development_Systems/canada|canada]]<br />
|20" iMac<br />
|1045A<br />
|142.204.133.123<br />
|OS X 10.5.6<br />
|<br />
|Built-in<br />
|<br />
|<br />
|<br />
|<br />
|<br />
<br />
|-<br />
|[[CDOT_Development_Systems/russia|russia]]<br />
|20" iMac<br />
|T1045<br />
|142.204.133.101<br />
|OS X 10.5.6<br />
|<br />
|Built-in<br />
|<br />
|<br />
|<br />
|<br />
|<br />
<br />
|-<br />
|[[CDOT_Development_Systems/easterisland|easterisland]]<br />
|Mac mini<br />
|T1045H - cubicle E<br />
|142.204.133.121<br />
|Mozilla build environment installed:<br /> Xcode, MacPorts, Mercurial, Autoconf, libidl<br />
|Currently awaiting re-installation<br />
|Samsung Syncmaster 245B<br />
|Internal + FW<br />
|<br />
|<br />
|<br />
|<br />
<br />
|-<br />
|[[CDOT_Development_Systems/spain|spain]]<br />
|Mac mini<br />
|T1045E - cubicle A<br />
|142.204.133.122<br />
|Mozilla build environment installed:<br /> Xcode, MacPorts, Mercurial, Autoconf, libidl<br />
|<br />
|Samsung Syncmaster 245B<br />
|Internal + FW<br />
|<br />
|<br />
|<br />
|<br />
<br />
|-<br />
|[[CDOT_Development_Systems/china|china]]<br />
|PC - Quad core, 4 Gb, 500 GB<br />
|T1045E - cubicle B<br />
|142.204.133.36<br />
|F12<br />
|<br />
|Viewsonic VA2226w (VSC 2051)<br />
|500GB (Failing!)<br />
|4GB - 4 banks<br />
|nVidia GeForce 8600 GT<br />
|Intel DQ35JO<br />
|Intel Q6600<br />
<br />
|-<br />
|[[CDOT_Development_Systems/liberia|liberia]]<br />
|PC -Quad Core, 8 GB, 1TB<br />
|T1045E - cubicle C<br />
|142.204.133.122<br />
|Windows 7<br />
|<br />
|SyncMaster 2443 - Dual Monitors<br />
|1TB<br />
|8GB<br />
|nVidia GeForce 8600 GT<br />
|Intel DQ35JO<br />
|Intel Core2 Quard CPU Q6600 @ 2.40GHz 2.30GHz<br />
<br />
|-<br />
|[[CDOT_Development_Systems/newzealand|newzealand]]<br />
|PC - Quad core, 8 GB, 4TB<br />
|T1045C<br />
|142.204.133.81<br />
|F16<br />
|<br />
|Samsung 1080P x 2<br />
|2X2TB<br />
|8GB - 4 banks<br />
|nVidia GeForce 8600 GT (?)<br />
|?<br />
|Intel Q6600<br />
<br />
|-<br />
|[[CDOT_Development_Systems/peru|peru]]<br />
|27" iMac<br />
|<br />
|142.204.133.7<br />
|Mac OS/X<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
<br />
|-<br />
|[[CDOT_Development_Systems/poland|poland]]<br />
|27" iMac<br />
|<br />
|142.204.133.26<br />
|Mac OS/X<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
<br />
|-<br />
|[[CDOT_Development_Systems/hongkong|hongkong]]<br />
|PC - Quad Core<br />
|Armory<br />
|142.204.133.150<br />
|F15<br />
|Function: Koji hub/web<br />
Services: apache (httpd)<br />
|KVM<br />
|Layout: 4x2TB Disks<br />
Config: raid 1 (primary partitions)<br />
<br />
Config: raid 5 (data partitions)<br />
|12GB<br />
|ATI<br />
|Intel<br />
|i7 CPU 950 @ 3.07GHz<br />
<br />
|-<br />
|[[CDOT_Development_Systems/ireland|ireland]]<br />
|PC - Quad core<br />
|Armory<br />
|142.204.133.153<br />
|F15<br />
|Function: database<br />
Services: PostgreSQL<br />
|KVM<br />
|Layout: 500GB, 2x128GB (solid state), 2TB, 1.5TB<br />
Config: raid 1 (data partitions)<br />
|8GB<br />
|NVIDIA<br />
|Intel<br />
|Core2 Quad CPU Q6600 @ 2.40GHz<br />
<br />
|-<br />
|[[CDOT Development Systems/chile|chile]]<br />
|PC - Quad core<br />
|Armory<br />
|142.204.133.101<br />
|F15<br />
|Function: Koji repo<br />
Services: NFS export<br />
|KVM<br />
|Layout: 3x2TB, 3x600GB (solid state)<br />
Config: raid 0 (solid state partitions)<br />
<br />
Config: raid 1 (mechanical partitions)<br />
|12G<br />
|NVIDIA<br />
|Intel<br />
|i7 CPU 930 @ 2.80GHz<br />
<br />
|-<br />
|[[CDOT_Development_Systems/australia|australia]]<br />
|PC - Quad Core<br />
|Armory<br />
|142.204.133.152<br />
|F15<br />
|Function: Koji Scratch<br />
Services: NFS exports<br />
|KVM<br />
|Layout: 1TB, 4x160GB (solid state)<br />
Config: raid 0 (solid state partitions)<br />
|8GB<br />
|Intel<br />
|Intel<br />
|Core2 Quad CPU Q6600 @ 2.40GHz<br />
<br />
|-<br />
|[[CDOT_Development_Systems/bahamas|bahamas]]<br />
|PC - Q6600<br />
|142.204.133.79<br />
|F16<br />
|Function: Developer PC, Virtualization Host, Web Server<br />
|Layout: 2x2TB Raid 1<br />
|8GB<br />
|Intel<br />
<br />
|}<br />
<br />
'''Tip:'''<br />
<br />
These hostnames have all been added to the <code>cdot.proximity.on.ca</code> domain for convenience. If you add that domain to your search domains in your DNS configuration, you can refer to the CDOT hosts by name. If you are using Linux or Mac OSX, you can add a search domain in your /etc/resolv.conf file by editing the ''search'' line:<br />
<br />
search whatever.was.already.here.com '''cdot.proximity.on.ca'''<br />
<br />
To configure this on a Linux/Unix/OSX system for which you do not have administrative rights, use the LOCALDOMAIN environment variable. For example, you could add this line to your <code>~/.bash_profile</code> or <code>~/.profile</code>:<br />
<br />
export LOCALDOMAIN="cdot.proximity.on.ca senecac.on.ca senecacollege.ca"<br />
<br />
Alternately, you can append the machine names and IPs to the '''hosts''' file (<code>/etc/hosts</code> on Linux and Mac OSX, <code>c:\windows\system32\drivers\etc\hosts</code> on Windows) -- do not delete the existing contents of that file, just add this text:<br />
<br />
# CDOT host file - from http://zenit.senecac.on.ca/wiki/index.php?title=CDOT_Development_Systems - 2009.01.28 version:<br />
142.204.133.7 canada<br />
142.204.133.22 scotland<br />
142.204.133.152 australia<br />
142.204.133.25 russia<br />
142.204.133.153 ireland<br />
142.204.133.28 india<br />
142.204.133.150 hongkong<br />
142.204.133.36 china<br />
142.204.133.121 easterisland<br />
142.204.133.122 spain<br />
142.204.133.123 liberia<br />
142.204.133.124 newzealand<br />
<br />
After doing this, you can access the machines by name: <code>ssh '''userid'''@liberia</code><br />
<br />
<!-- = CDOTnet =<br />
<br />
A gigabit ethernet LAN connects the PCs in the south end of CDOT (Australia, India, China, Ireland, and Scotland). The IP addresses on this LAN are 172.30.30.''X'', where ''X'' is the same last octet as the machine's external interface. These machines have DNS entries within the cdot.proximity.on.ca subdomain which are the same as the hostname with "2" appended (e.g., india2.cdot.proximity.on.ca refers to the CDOTnet interface on the host "india").<br />
<br />
CDOTnet has no external interface and is therefore only useful for communication between the machines directly connected to it.<br />
<br />
### CDOTNet is no longer connected ###<br />
<br />
--><br />
<br />
= Equipment =<br />
* Four PCs - quad-core, 8GB RAM, 1TB disk<br />
* Four PCs - quad-core, 4GB RAM, 500GB disk<br />
* One PC - quad-core, 8GB RAM, 6*1.5TB disk<br />
* Two Mac Minis - dual-core, 2GB RAM, 120GB disk + external drive, 24" displays<br />
* Two iMacs - dual-core, 4GB RAM, ???GB disk, 20" display<br />
<br />
= Configuration =<br />
* On the 64-bit PCs:<br />
** Install the current version of Fedora as the base OS<br />
** Use virtual machines (KVM) as necessary:<br />
*** Linux (Fedora or other)<br />
*** Windows Vista<br />
*** Windows XP SP3<br />
* Some PCs will have Windows XP/Vista installed as the base OS (for high-performance video access, i.e., Canvas3D):<br />
** NewZealand<br />
* Install the toolchain(s) required (e.g., for Mozilla development - [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites Win]/[http://developer.mozilla.org/en/docs/Linux_Build_Prerequisites Linux]/[http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites Mac])<br />
<br />
= PC Partitioning =<br />
==500GB Drives==<br />
'''Drives are ~500 GB:'''<br />
* Partition 1: 150 GB NTFS containing XP SP2<br />
* Partition 2: 100 GB NTFS containing Vista<br />
* Partition 3: 100 MB Linux boot partition<br />
* Partition 4: Extended partition<br />
* Partitions 5-9: 50 GB Linux LVM PVs (last one will be smaller)<br />
<br />
'''Linux LVM LV layout:'''<br />
* 50 GB / filesystem (ext3)<br />
* 80 GB /home filesystem (ext3)<br />
* 50 GB /var filesystem<br />
<br />
==1TB Drives==<br />
'''Drives are ~1000 GB:'''<br />
* Partition 1: 200 MB ext3 /boot<br />
* Partition 2: 200 MB ext3 /boot2<br />
* Partition 3: 200GB LVM PV<br />
* Partition 4: Extended partition<br />
* Partitions 5-9: 200GB LVM PV (last one sized as needed)<br />
<br />
'''Linux LVM LV layout:'''<br />
* 50 GB / filesystem (ext3)<br />
* 50 GB /home filesystem (ext3)<br />
* 50 GB /var filesystem<br />
* 8 GB swap filesystem<br />
<br />
==2x2TB Drives==<br />
*Drive 1<br />
** Partition 1: 500M /boot<br />
** Partition 2: 500G PV<br />
** Partition 3: 500G PV<br />
** Partition 4: 500G PV<br />
** Partition 5: 500G PV<br />
<br />
* Drive 2<br />
** Partition 1: 500G PV<br />
** Partition 2: 500G PV<br />
** Partition 3: 500G PV<br />
** Partition 4: 500G PV<br />
<br />
'''Initial Linux LVM LV layout:'''<br />
* 100G / ext4<br />
* 1T /home ext4<br />
<br />
= Software to be installed =<br />
<br />
(Remember, other tools can be added later!)<br />
* Build tools required for Mozilla build ([http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites Win]/[http://developer.mozilla.org/en/docs/Linux_Build_Prerequisites Linux]/[http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites Mac]). NOTE: use VS.NET Pro on Win32 vs. Express<br />
* [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY] on WinXP/Vista<br />
* Current version of FF and TB<br />
<br />
=== Mac installed software ===<br />
* Xcode3.0<br />
* fink - (http://www.finkproject.org/download/srcdist.php)<br />
** download tarball, untar and ./boostrap (prees enter all the time to choose default)<br />
** . /sw/bin/pathsetup.sh<br />
** fink selfupdate-cvs<br />
** fink install orbit orbit-dev <br />
** sudo apt-get glib<br />
<br />
= Computer setup =<br />
== Windows setup ==<br />
# I used [http://www.cpuid.com/cpuz.php CPUID] to discover the motherboard <br />
# Install ethernet drivers (Installed PRO2KXP.exe -- Ver:12.4 -- Date:2/24/2008 -- Size:11414 KB)<br />
# http://www.windowsupdate.com until you get all updates<br />
<br />
= Network setup =<br />
* 142.204.133.65 Gateway<br />
* 255.255.255.192 Netmask<br />
* 142.204.43.43 DNS 1<br />
* 142.204.1.2 DNS2<br />
<br />
= Security = <br />
<br />
* Disable remote root/admin login on all operating systems.<br />
<br />
= Accounts =<br />
<br />
* Please create an account for yourself and use it for all development work on these machines.<br />
<br />
= Resources =<br />
<br />
* Reinstalling GRUB (needed to restore access to Linux when Windows is installed after Linux): http://dailypackage.fedorabook.com/index.php?/archives/161-System-Recovery-Week-Dealing-with-Disk-Images.html<br />
<br />
[[Image:Ori-macmini.jpg]] [[Image:Ori-pc.jpg]]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=NexJ-CDOT_Knowledge_Base&diff=84792NexJ-CDOT Knowledge Base2012-05-01T13:27:45Z<p>Gbatumbya: </p>
<hr />
<div>[[Category:NexJ_Express]]<br />
<br />
<br />
== Purpose ==<br />
The research activities of creating the NexJ-CDOT knowledge base at CDOT-Seneca has three goals in mind.<br />
*It will enable new research students to go through a shorter learning curve in working with the huge code base of NexJ Model Server Express (i.e the NexJ Framework).<br />
*It will benefit the open source community of developers who want to make contributions to the NexJ Express code base.<br />
*It will be a repository of various software artifacts that have been produced during the process of working with the code base of NexJ Model Server Express.<br />
<br />
== Documents Provided by NexJ ==<br />
* Introduction To NexJ Studio Express ('''open sourced''', available on Open Health Tools Platform) [https://projects.openhealthtools.org/sf/projects/oht_aip/]<br />
* NexJ Studio Fundamentals (confidential and proprietary)<br />
* NexJ Studio - Integration Fundamentals (confidential and proprietary)<br />
* Working with NexJ Express Source Code ('''open sourced''', available on Open Health Tools Platform)<br />
* NexJ Systems Developer's Guide (confidential and proprietary)<br />
<br />
== NexJ Software Engineering Practice ==<br />
* agile software engineering<br />
** SCRUM<br />
*** the SQLite Adapter project<br />
* emphasis on '''performance and optimization'''<br />
** the PostgreSQL Adapter project [http://gbatumbya.wordpress.com/2011/10/31/postgresql-support-added-to-nexj-express/]<br />
*** "There was an emphasis placed on optimizing the code and making use of the things that PostgreSQL is “good at”." (Grace)<br />
** the JSON Message Adapter project<br />
<br />
== NexJ Framework Concepts As Mined From The NexJ Training Tutorial Documents ==<br />
* [[Research Notes - NexJ Training Tutorials | research notes]]<br />
<br />
== NexJ Framework Design Concepts As Mined From The Code Repositories ==<br />
<br />
=== The Persitence Engine ===<br />
* '''projects:''' the PostgreSQL Adapter, the SQLite Adapter<br />
* [[NexJ-SQLite: User Stories 1, 3 |research notes on the code base (SQLite Adapter)]]<br />
<br />
=== The Integration Engine ===<br />
* '''project:''' the JSON Message Adapter [http://brianlimtemp.blogspot.com/2011_07_01_archive.html]<br />
* the NexJ Message concept<br />
** [[ NexJ Message Concept - Mapping to the Code Base|research notes on the code base]]<br />
* the NexJ Channel concept<br />
* the NexJ Transformation concept<br />
<br />
== Resources ==<br />
*'''Hazzan and Dubinsky: Agile Software Engineering (Springer 2009)''' [http://www.springer.com/computer/swe/book/978-1-84800-198-5]<br />
** a multifaceted approach: the human perspective, the organizational perspective, the technological approach (HOT)<br />
* '''An Exploratory Study of How Developers Seek, Relate, and Collect Relevant Informaiton during Software Maintenance Tasks.''' IEEE Transactions of Software Engineering, 32(12), 2006, pp. 971-987.<br />
*Hazzan, O. (2002). '''The reflective practitioner perspective in software engineering education''', The Journal of Systems and Software 63(3), pp. 161-171.<br />
*Hazzan, O. and Tomayko, J. (2003). '''The reflective practitioner perspective in eXtreme Programming''', Proceedings of the XP Agile Universe 2003, New Orleans, Louisiana, USA, pp. 51-61.<br />
* Theories, tools and research methods in program comprehension: past, present and future (Margaret-Anne Storey, University of Victoria, 2008) [http://webhome.cs.uvic.ca/~chisel/pubs/storey-pc-journal.pdf]<br />
** [[Notes on Program Comprehension |notes]] (agile development, open source)</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=84660SQLite Adapter StandUp Reports2012-04-16T03:58:08Z<p>Gbatumbya: /* Week 14: Apr 9 */</p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
=Week 14: Apr 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Testing with Studio Express<br />
* Fixing bug when multiple threads try to write to the database file<br />
* Updated NexJ about progress on project<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* n/a<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|<br />
* Waiting on response as to whether it is fine to run SQLite in a transactionless way.<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|<br />
* Code review 1<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Testing with Studio Express<br />
* Fixing bug when multiple threads try to write to the database file<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Testing with Studio Express<br />
* Patch review<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 13: Apr 2=<br />
==Thursday==<br />
<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
* Testing with Studio Express<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Software Design Documentation<br />
* Testing with Studio Express<br />
|<br />
* Testing with Studio Express<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
n/a<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
* Testing with Studio Express<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 12: Mar 26=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed SQLite open behaviour when a database does not exist<br />
* Reviewed adapter patch<br />
* Code styling<br />
* Software design document<br />
|<br />
* Reviewed locale work<br />
* Reviewed open behaviour work<br />
* Software design document<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Documentation<br />
* Adapter patch review<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Added custom build step to generate nexj_sqlite file in visual studio projects<br />
* Added content to software design document<br />
* Added keywords to adapter<br />
* Fixed creation of views<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Code cleanup<br />
* SQLite open behaviour<br />
|<br />
* Testing adapter with studio<br />
* Finishing up software design document<br />
* Reviewing adapter patch<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 11: Mar 19=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed testNew, the setup scripts were wrong<br />
* Fixed testRanges, a bug with incrementing primary keys<br />
|<br />
* Reviewed locale code<br />
* Running Unit tests on upgraded core<br />
* Code cleanup<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Code cleanup<br />
* SQLite open behaviour<br />
|<br />
*Testing adapter with studio<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|Code review<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Rebased adapter code to latest core<br />
* Implementing locale in SQLite<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Fixing testNew<br />
<br />
|<br />
* Running unit tests<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 10: Mar 12=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Investigated failing test, testQueryTimeout<br />
* Attempted a fix<br />
|<br />
* Fixed bug where BLOB values were not being correctly set on prepared statements<br />
* Fixed bug that was causing a column meta data mismatch when reading a schema from a database<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Failing test, testQueryTimeout<br />
* Failing test, testNew<br />
|<br />
*Rebasing adapter code to latest core<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Got windows build command for project makefile<br />
* Fixed and issued with the sqltie shell project not compiling<br />
|<br />
* Testing with new JDBC driver build<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Investigating failing tests<br />
|<br />
* Fix reading of column meta data when reading a database schema<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 9: Mar 5=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Solved link error<br />
* added more code generation for nativedb.c & .h & .class<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* getting the windows binaries in a working state<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 8: Feb 27=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Investigating an unsatisfied link error<br />
|<br />
* Built SQLite library on Linux with ICU statically linked<br />
* Started on extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Solving said error<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed the source builder<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Improving the build system<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
*Implemented sqlite_nexj.c source building in the make file<br />
*Removed the xerial source, altering our make file<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
*Improving the build system<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A<br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=84433SQLite Adapter StandUp Reports2012-04-09T16:57:56Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
=Week 14: Apr 9=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Testing with Studio Express<br />
* Fixing bug when multiple threads try to write to the database file<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Testing with Studio Express<br />
* Patch review<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 13: Apr 2=<br />
==Thursday==<br />
<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
* Testing with Studio Express<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Software Design Documentation<br />
* Testing with Studio Express<br />
|<br />
* Testing with Studio Express<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
n/a<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
* Testing with Studio Express<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 12: Mar 26=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed SQLite open behaviour when a database does not exist<br />
* Reviewed adapter patch<br />
* Code styling<br />
* Software design document<br />
|<br />
* Reviewed locale work<br />
* Reviewed open behaviour work<br />
* Software design document<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Documentation<br />
* Adapter patch review<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Added custom build step to generate nexj_sqlite file in visual studio projects<br />
* Added content to software design document<br />
* Added keywords to adapter<br />
* Fixed creation of views<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Code cleanup<br />
* SQLite open behaviour<br />
|<br />
* Testing adapter with studio<br />
* Finishing up software design document<br />
* Reviewing adapter patch<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 11: Mar 19=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed testNew, the setup scripts were wrong<br />
* Fixed testRanges, a bug with incrementing primary keys<br />
|<br />
* Reviewed locale code<br />
* Running Unit tests on upgraded core<br />
* Code cleanup<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Code cleanup<br />
* SQLite open behaviour<br />
|<br />
*Testing adapter with studio<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|Code review<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Rebased adapter code to latest core<br />
* Implementing locale in SQLite<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Fixing testNew<br />
<br />
|<br />
* Running unit tests<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 10: Mar 12=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Investigated failing test, testQueryTimeout<br />
* Attempted a fix<br />
|<br />
* Fixed bug where BLOB values were not being correctly set on prepared statements<br />
* Fixed bug that was causing a column meta data mismatch when reading a schema from a database<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Failing test, testQueryTimeout<br />
* Failing test, testNew<br />
|<br />
*Rebasing adapter code to latest core<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Got windows build command for project makefile<br />
* Fixed and issued with the sqltie shell project not compiling<br />
|<br />
* Testing with new JDBC driver build<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Investigating failing tests<br />
|<br />
* Fix reading of column meta data when reading a database schema<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 9: Mar 5=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Solved link error<br />
* added more code generation for nativedb.c & .h & .class<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* getting the windows binaries in a working state<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 8: Feb 27=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Investigating an unsatisfied link error<br />
|<br />
* Built SQLite library on Linux with ICU statically linked<br />
* Started on extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Solving said error<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed the source builder<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Improving the build system<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
*Implemented sqlite_nexj.c source building in the make file<br />
*Removed the xerial source, altering our make file<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
*Improving the build system<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A<br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter&diff=84332SQLite Adapter2012-04-05T17:43:45Z<p>Gbatumbya: /* Supported Versions */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express SQLite]]<br />
<br />
<big><big> SQLite Adapter for NexJ </big></big><br />
<br />
<br />
== Project Goal ==<br />
Develop an adapter to enable NexJ Express's model interaction with SQLite databases.<br />
<!--<br />
=== Software Design Document ===<br />
[https://docs.google.com/document/d/1aX9YqdXcABKmxegTcovyZXqWYp_9NnPmke6QU8jfiBU/edit?hl=en_US Read only]<br />
--><br />
<br />
<br />
=== Contributors ===<br />
* [[User:Cwdesautels|Carl Desautels]]<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Abhishekbh|Abhishek Bhatnagar]]<br />
* [[User:Wei.song | Wei Song]]<br />
<br />
=== Supported Versions ===<br />
* sqlite.3.7.10 <br />
** Compiled with the following flags:<br />
***SQLITE_ENABLE_LOAD_EXTENSION=1<br />
***SQLITE_ENABLE_UPDATE_DELETE_LIMIT<br />
***SQLITE_ENABLE_COLUMN_METADATA<br />
***SQLITE_CORE<br />
***SQLITE_ENABLE_FTS4<br />
***SQLITE_ENABLE_FTS3_PARENTHESIS<br />
***SQLITE_ENABLE_RTREE<br />
***SQLITE_ENABLE_STAT3<br />
***SQLITE_SOUNDEX=1<br />
***SQLITE_MAX_VARIABLE_NUMBER=4000<br />
***SQLITE_USE_URI<br />
***SQLITE_ENABLE_ICU<br />
***SQLITE_DEFAULT_FOREIGN_KEYS=1<br />
***DSQLITE_THREADSAFE=1<br />
<br />
== Project Status==<br />
* '''Current Sprint''' : [[SQLite_Adapter#Sprint_3 | 3]]<br />
* [[SQLite_Adapter_StandUp_Reports | Stand Up Reports]]<br />
<br />
<br />
== Project Backlog ==<br />
=== Investigation (DONE) ===<br />
* Research SQLite / JDBC driver<br />
* Get requirements from NexJ (Meeting Friday Sept 23rd)<br />
* [[SQLite_Adapter_Research | Research Summary]]<br />
<br />
<br />
=== Sprint: 1 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
|Initial skeleton of the SQLite adapter<br />
|2<br />
|Running the jUnit test shows in the console that the adapter is loaded an running.<br />
|-<br />
|Use database schema tool to generate the SQL to setup the database<br />
|1<br />
|Running the DB Schema Tool's "setup" command, appropriate artifacts are created (e.g. sql or bat script) for generating the SQLite database.<br />
|-<br />
|Use database schema tool to generate the SQL to create the Core datasource's tables<br />
|5<br />
|Running the DB Schema Tool's "create" command, appropriate artifacts are created (e.g. a sql file) for creating the tables in an existing SQLite database.<br />
|}<br />
<br />
<br />
=== Sprint 2 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Use data schema tool to generate the SQL to insert the data from a dump file<br />
| 0<br />
| Running the DB schema Tool's 'insert' command, appropriate artifacts are created in the database<br />
|-<br />
| Use the scheme console to insert into and read from the database<br />
| 0<br />
| Running the schema console, perform multi-transactional inserts with commits and rollbacks. Reading from the database to confirm updates<br />
|-<br />
| Use the data load tool to extract information in a SQLite database and persist it to a dump file<br />
| 0<br />
| Running the data load tool, read information from the database and export it to a dump file<br />
|-<br />
| Use the database schema tool to create an insert script for all the instances in in a SQLite database<br />
| 0<br />
| Running the data load tool, read in information from a dump file<br />
|-<br />
| Add an attribute to the User class, add the column to the datasource and Main.upgrade. Use the data load tool to upgrade the SQLite database. The database now has the new column add to the User Table<br />
| 3<br />
| Running the database schema tool alter the user class and perform an upgrade<br />
|-<br />
| Run each of the data load tool commands to validate their use<br />
| 5<br />
| Running all of the data load tool's commands, checking for expected results<br />
|-<br />
| Run each of the database schema tool commands to validate their use<br />
| 5<br />
| Running all of the database schema tools commands, checking for expected results<br />
|}<br />
<br />
<br />
=== Sprint 3 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Retrieve a record using fulltext search in the where clause<br />
| 0<br />
| Using the SQlite Adapter perform a query to verify the full test search options have been configured properly<br />
|-<br />
| Demonstrate unicode support in sqlite functions<br />
| 5<br />
| Using the SQlite Adapter perform a query to verify unicode support is as expected in sqlite functions<br />
|-<br />
| Run all SQLiteSchemaManager unit tests, to validate correctness<br />
| 2<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|-<br />
| Run all the SQLiteAdapter unit tests, to validate correctness<br />
| 7<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|}<br />
<br />
<br />
== Project Repository ==<br />
* Central: https://bitbucket.org/cwdesautels/nexj-express-sqlite-adapter<br />
<br />
<br />
== Building JDBC from source ==<br />
* [[SQLite_Xerial_JDBC_From_Source | HowTo]] <br />
<br />
<br />
== Resources ==<br />
* Dowloads:<br />
** http://www.sqlite.org/download.html<br />
* Documentation:<br />
** Root - http://www.sqlite.org/docs.html<br />
** About - http://www.sqlite.org/about.html<br />
** Types - http://www.sqlite.org/datatype3.html<br />
** Limits - http://www.sqlite.org/limits.html<br />
** Null Handling - http://www.sqlite.org/nulls.html<br />
** Omitted Features - http://www.sqlite.org/omitted.html<br />
** SQL to SQLite - http://www.sqlite.org/lang_expr.html<br />
** API - http://www.sqlite.org/c3ref/intro.html<br />
* QuickStart:<br />
** Usage - http://www.sqlite.org/cintro.html<br />
** C Interface - http://www.sqlite.org/cintro.html<br />
* SQLite JDBC Driver:<br />
** (Unoffical) http://www.xerial.org/trac/Xerial</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=84327SQLite Adapter StandUp Reports2012-04-05T13:20:30Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
--><br />
<br />
=Week 13: Apr 2=<br />
==Thursday==<br />
<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
* Testing with Studio Express<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Testing with Studio Express<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
* Testing with Studio Express<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 12: Mar 26=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed SQLite open behaviour when a database does not exist<br />
* Reviewed adapter patch<br />
* Code styling<br />
* Software design document<br />
|<br />
* Reviewed locale work<br />
* Reviewed open behaviour work<br />
* Software design document<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Documentation<br />
* Adapter patch review<br />
|<br />
* Software Design Documentation<br />
* Adapter patch review<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Added custom build step to generate nexj_sqlite file in visual studio projects<br />
* Added content to software design document<br />
* Added keywords to adapter<br />
* Fixed creation of views<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Code cleanup<br />
* SQLite open behaviour<br />
|<br />
* Testing adapter with studio<br />
* Finishing up software design document<br />
* Reviewing adapter patch<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 11: Mar 19=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed testNew, the setup scripts were wrong<br />
* Fixed testRanges, a bug with incrementing primary keys<br />
|<br />
* Reviewed locale code<br />
* Running Unit tests on upgraded core<br />
* Code cleanup<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Code cleanup<br />
* SQLite open behaviour<br />
|<br />
*Testing adapter with studio<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|Code review<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
n/a<br />
|<br />
* Rebased adapter code to latest core<br />
* Implementing locale in SQLite<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Fixing testNew<br />
<br />
|<br />
* Running unit tests<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 10: Mar 12=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Investigated failing test, testQueryTimeout<br />
* Attempted a fix<br />
|<br />
* Fixed bug where BLOB values were not being correctly set on prepared statements<br />
* Fixed bug that was causing a column meta data mismatch when reading a schema from a database<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Failing test, testQueryTimeout<br />
* Failing test, testNew<br />
|<br />
*Rebasing adapter code to latest core<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Got windows build command for project makefile<br />
* Fixed and issued with the sqltie shell project not compiling<br />
|<br />
* Testing with new JDBC driver build<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Investigating failing tests<br />
|<br />
* Fix reading of column meta data when reading a database schema<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 9: Mar 5=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Solved link error<br />
* added more code generation for nativedb.c & .h & .class<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* getting the windows binaries in a working state<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 8: Feb 27=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Investigating an unsatisfied link error<br />
|<br />
* Built SQLite library on Linux with ICU statically linked<br />
* Started on extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Solving said error<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Fixed the source builder<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Improving the build system<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
*Implemented sqlite_nexj.c source building in the make file<br />
*Removed the xerial source, altering our make file<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
*Improving the build system<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A<br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=83602SQLite Adapter StandUp Reports2012-03-26T12:08:38Z<p>Gbatumbya: /* Monday */</p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
--><br />
=Week 12: Mar 26=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Added custom build step to generate nexj_sqlite file in visual studio projects<br />
* Added content to software design document<br />
* Added keywords to adapter<br />
* Fixed creation of views<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Testing adapter with studio<br />
* Finishing up software design document<br />
* Reviewing adapter patch<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 11: Mar 19=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Reviewed locale code<br />
* Running Unit tests on upgraded core<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Testing adapter with studio<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|Code review<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Rebased adapter code to latest core<br />
* Implementing locale in SQLite<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Running unit tests<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 10: Mar 12=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Fixed bug where BLOB values were not being correctly set on prepared statements<br />
* Fixed bug that was causing a column meta data mismatch when reading a schema from a database<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Rebasing adapter code to latest core<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Testing with new JDBC driver build<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Fix reading of column meta data when reading a database schema<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 9: Mar 5=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 8: Feb 27=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Built SQLite library on Linux with ICU statically linked<br />
* Started on extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A<br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=83601SQLite Adapter StandUp Reports2012-03-26T12:06:03Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
--><br />
=Week 12: Mar 26=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Added custom build step to generate nexj_sqlite file in visual studio projects<br />
* Added content to software design document<br />
* Added keywords to adapter<br />
* Fixed creation of views<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Testing adapter with studio<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 11: Mar 19=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Reviewed locale code<br />
* Running Unit tests on upgraded core<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Testing adapter with studio<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|Code review<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Rebased adapter code to latest core<br />
* Implementing locale in SQLite<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Running unit tests<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 10: Mar 12=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Fixed bug where BLOB values were not being correctly set on prepared statements<br />
* Fixed bug that was causing a column meta data mismatch when reading a schema from a database<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Rebasing adapter code to latest core<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Testing with new JDBC driver build<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Fix reading of column meta data when reading a database schema<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 9: Mar 5=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 8: Feb 27=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Built SQLite library on Linux with ICU statically linked<br />
* Started on extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A<br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter&diff=83435SQLite Adapter2012-03-23T22:08:53Z<p>Gbatumbya: /* Supported Versions */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express SQLite]]<br />
<br />
<big><big> SQLite Adapter for NexJ </big></big><br />
<br />
<br />
== Project Goal ==<br />
Develop an adapter to enable NexJ Express's model interaction with SQLite databases.<br />
<!--<br />
=== Software Design Document ===<br />
[https://docs.google.com/document/d/1aX9YqdXcABKmxegTcovyZXqWYp_9NnPmke6QU8jfiBU/edit?hl=en_US Read only]<br />
--><br />
<br />
<br />
=== Contributors ===<br />
* [[User:Cwdesautels|Carl Desautels]]<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Abhishekbh|Abhishek Bhatnagar]]<br />
* [[User:Wei.song | Wei Song]]<br />
<br />
=== Supported Versions ===<br />
* sqlite.3.7.10 <br />
** Compiled with the following flags:<br />
***SQLITE_ENABLE_LOAD_EXTENSION=1<br />
***SQLITE_ENABLE_UPDATE_DELETE_LIMIT<br />
***SQLITE_ENABLE_COLUMN_METADATA<br />
***SQLITE_CORE<br />
***SQLITE_ENABLE_FTS4<br />
***SQLITE_ENABLE_FTS3_PARENTHESIS<br />
***SQLITE_ENABLE_RTREE<br />
***SQLITE_ENABLE_STAT3<br />
***SQLITE_SOUNDEX=1<br />
***SQLITE_MAX_VARIABLE_NUMBER=4000<br />
***SQLITE_USE_URI<br />
***SQLITE_ENABLE_ICU<br />
***SQLITE_DEFAULT_FOREIGN_KEYS=1<br />
<br />
== Project Status==<br />
* '''Current Sprint''' : [[SQLite_Adapter#Sprint_3 | 3]]<br />
* [[SQLite_Adapter_StandUp_Reports | Stand Up Reports]]<br />
<br />
<br />
== Project Backlog ==<br />
=== Investigation (DONE) ===<br />
* Research SQLite / JDBC driver<br />
* Get requirements from NexJ (Meeting Friday Sept 23rd)<br />
* [[SQLite_Adapter_Research | Research Summary]]<br />
<br />
<br />
=== Sprint: 1 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
|Initial skeleton of the SQLite adapter<br />
|2<br />
|Running the jUnit test shows in the console that the adapter is loaded an running.<br />
|-<br />
|Use database schema tool to generate the SQL to setup the database<br />
|1<br />
|Running the DB Schema Tool's "setup" command, appropriate artifacts are created (e.g. sql or bat script) for generating the SQLite database.<br />
|-<br />
|Use database schema tool to generate the SQL to create the Core datasource's tables<br />
|5<br />
|Running the DB Schema Tool's "create" command, appropriate artifacts are created (e.g. a sql file) for creating the tables in an existing SQLite database.<br />
|}<br />
<br />
<br />
=== Sprint 2 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Use data schema tool to generate the SQL to insert the data from a dump file<br />
| 0<br />
| Running the DB schema Tool's 'insert' command, appropriate artifacts are created in the database<br />
|-<br />
| Use the scheme console to insert into and read from the database<br />
| 0<br />
| Running the schema console, perform multi-transactional inserts with commits and rollbacks. Reading from the database to confirm updates<br />
|-<br />
| Use the data load tool to extract information in a SQLite database and persist it to a dump file<br />
| 0<br />
| Running the data load tool, read information from the database and export it to a dump file<br />
|-<br />
| Use the database schema tool to create an insert script for all the instances in in a SQLite database<br />
| 0<br />
| Running the data load tool, read in information from a dump file<br />
|-<br />
| Add an attribute to the User class, add the column to the datasource and Main.upgrade. Use the data load tool to upgrade the SQLite database. The database now has the new column add to the User Table<br />
| 3<br />
| Running the database schema tool alter the user class and perform an upgrade<br />
|-<br />
| Run each of the data load tool commands to validate their use<br />
| 5<br />
| Running all of the data load tool's commands, checking for expected results<br />
|-<br />
| Run each of the database schema tool commands to validate their use<br />
| 5<br />
| Running all of the database schema tools commands, checking for expected results<br />
|}<br />
<br />
<br />
=== Sprint 3 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Retrieve a record using fulltext search in the where clause<br />
| 0<br />
| Using the SQlite Adapter perform a query to verify the full test search options have been configured properly<br />
|-<br />
| Demonstrate unicode support in sqlite functions<br />
| 5<br />
| Using the SQlite Adapter perform a query to verify unicode support is as expected in sqlite functions<br />
|-<br />
| Run all SQLiteSchemaManager unit tests, to validate correctness<br />
| 2<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|-<br />
| Run all the SQLiteAdapter unit tests, to validate correctness<br />
| 7<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|}<br />
<br />
<br />
== Project Repository ==<br />
* Central: https://bitbucket.org/cwdesautels/nexj-express-sqlite-adapter<br />
<br />
<br />
== Building JDBC from source ==<br />
* [[SQLite_Xerial_JDBC_From_Source | HowTo]] <br />
<br />
<br />
== Resources ==<br />
* Dowloads:<br />
** http://www.sqlite.org/download.html<br />
* Documentation:<br />
** Root - http://www.sqlite.org/docs.html<br />
** About - http://www.sqlite.org/about.html<br />
** Types - http://www.sqlite.org/datatype3.html<br />
** Limits - http://www.sqlite.org/limits.html<br />
** Null Handling - http://www.sqlite.org/nulls.html<br />
** Omitted Features - http://www.sqlite.org/omitted.html<br />
** SQL to SQLite - http://www.sqlite.org/lang_expr.html<br />
** API - http://www.sqlite.org/c3ref/intro.html<br />
* QuickStart:<br />
** Usage - http://www.sqlite.org/cintro.html<br />
** C Interface - http://www.sqlite.org/cintro.html<br />
* SQLite JDBC Driver:<br />
** (Unoffical) http://www.xerial.org/trac/Xerial</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=83354SQLite Adapter StandUp Reports2012-03-22T14:23:12Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
--><br />
=Week 11: Mar 19=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Reviewed locale code<br />
* Running Unit tests on upgraded core<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Testing adapter with studio<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|Code review<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Rebased adapter code to latest core<br />
* Implementing locale in SQLite<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Running unit tests<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 10: Mar 12=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Fixed bug where BLOB values were not being correctly set on prepared statements<br />
* Fixed bug that was causing a column meta data mismatch when reading a schema from a database<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Rebasing adapter code to latest core<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Testing with new JDBC driver build<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Fix reading of column meta data when reading a database schema<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 9: Mar 5=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 8: Feb 27=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Built SQLite library on Linux with ICU statically linked<br />
* Started on extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A<br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=GAM670/DPS905_Weekly_Schedule_20121&diff=82689GAM670/DPS905 Weekly Schedule 201212012-03-09T14:41:20Z<p>Gbatumbya: /* This Week */</p>
<hr />
<div>{{GAM670/DPS905 Index | 20121}}<br />
= GAM670/DPS905 -- Weekly Schedule 20121=<br />
<br />
== Week 1 - Jan 8 ==<br />
<br />
=== This Week ===<br />
* Assignment Discussion<br />
* Suggested Enhancements<br />
* Review of the Base Code<br />
** Definition of a Framework<br />
*** Modularity through stable interfaces<br />
*** Re-usability through generic components<br />
*** Extensibility through hook methods<br />
*** Inversion of control - determines which application methods to invoke in response to external events<br />
** Framework Architecture<br />
*** Modelling Layer<br />
*** API Translation Layer<br />
** Notable Features of the Base Code<br />
** camera, sound, and light are also derived from the Frame class<br />
** textures attach at the object level<br />
** texture connection is uncoupled from drawing of the graphics primitives<br />
** reference frames are relative<br />
** very simple collision detection<br />
<br />
=== To Do ===<br />
<br />
# add your name to the student list<br />
# create a team page that includes the semester number 20121<br />
#* describe the game that you intend to develop<br />
#* list the topics of interest to your team in developing its game<br />
#* list the other topics of interest<br />
<!--<br />
# Port Game Design over to Update Base Code--><br />
<br />
=== Resources ===<br />
<br />
<br />
== Week 2 - Jan 16 ==<br />
<br />
=== This Week ===<br />
<br />
* Relative Reference Frames<br />
** Recursive calls<br />
**: Vector Frame::position()<br />
**: Matrix Frame::rotation()<br />
**: Matrix Frame::world()<br />
** Detaching from and attaching to a parent frame<br />
**: Frame::attachTo()<br />
* Geometry<br />
** Plane<br />
**: normal + constant - examples<br />
**: equation of a plane: dot(n, x) + D = 0<br />
**: positive side of a plane dot(n, x) + D > 0<br />
* Collision Detection<br />
*: types of colliders<br />
*:: spheres<br />
*:: planes<br />
*:: axis-aligned bounding boxes<br />
*:: oriented bounding boxes<br />
<br />
=== To Do ===<br />
* Research the feature that you are going to add and prepare a plan of action<br />
* Prepare a team page for your team so that repos can be ordered<br />
* Add a section to your team page to track your project and solicit commentary<br />
<br />
=== Resources ===<br />
<br />
== Week 3 - Jan 23 ==<br />
=== This Week ===<br />
* Collision Detection (cont'd)<br />
*: Shape<br />
*:: Shape : Frame<br />
*:: Shape::setRadius()<br />
*:: Shape::getRadius()<br />
*:: Shape::setRadius(float r);<br />
*:: Shape::setRadius(float x, float y, float z);<br />
*:: Shape::getRadius() const { return radius; }<br />
*:: Shape::setPlane(Vector n, float d);<br />
*:: Shape::setAxisAligned(Vector min, Vector max);<br />
* Comprehensive Camerawork<br />
*: rotation about an axis<br />
*: order of rotation matters<br />
*: Euler angles<br />
*:: [http://www.youtube.com/watch?v=UpSMNYTVqQI&feature=related 3-2-1 angles]<br />
*: gimbal lock<br />
*:: [http://www.youtube.com/watch?v=rrUCBOlJdt4&feature=related StephenSeefeld.net]<br />
*: complex numbers<br />
*:: solution of cubic equations 16th century<br />
*:: two-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers matrix representation]<br />
*: quaternions<br />
*:: extension of complex numbers<br />
*:: four-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Quaternion#Matrix_representations matrix representation]<br />
*: geometric algebra (more abstract)<br />
*:: [http://staff.science.uva.nl/~leo/cinderella/line1.html Dorst's site]<br />
*:: [http://sinai.apphy.u-fukui.ac.jp/gcj/software/GAcindy-1.4/GAcindy.htm Hitzer's site]<br />
* Visibility Determination<br />
**: test a point for presence within a set of planes<br />
**: normal calculations - general rotation matrix - vector and angle<br />
** ViewFrustum<br />
**: parameter - view * projection<br />
**: 6 planes<br />
**:: near and far planes<br />
**:: left and right planes<br />
**:: top and bottom planes<br />
**: coding<br />
**:: constructor<br />
**:: ViewFrustum::contains()<br />
** Finite Size of Objects<br />
**: Expansion of the View Frustum<br />
* Index Buffers<br />
*: amount of storage needed for vertex data<br />
*: duplication of vertex data<br />
*: indexing<br />
*: indexed primitives<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://en.wikipedia.org/wiki/Complex_number Wikipedia on Complex Numbers]<br />
* [http://en.wikipedia.org/wiki/Quaternion Wikipedia on Quaternions]<br />
* [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Wikipedia on quaternions and Spatial Rotations]<br />
* [http://mathworld.wolfram.com/Quaternion.html Wolfram on Quaternions]<br />
* [http://www.cprogramming.com/tutorial/3d/quaternions.html CProgramming.com on Quaternions]<br />
* [http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer Ogre intro on Quaternions]<br />
* collision sample<br />
* indexBuffering sample<br />
<br />
<br />
== Week 4 - Jan 30 ==<br />
=== This Week ===<br />
* Meshes<br />
*: What is a mesh?<br />
*:: vertex list -> vertex buffer<br />
*:: index list -> index buffer<br />
*:: attribute list -> subset to which primitives belong<br />
*:: pyramid sample<br />
*: Stock Objects<br />
*:: Sphere<br />
*::: slices and partitions<br />
*:: Cylinder<br />
*:: Torus<br />
*:: Utah Teapot<br />
*:: APIGraphic.h and .cpp code<br />
*: Custom Mesh<br />
*:: Create a Mesh<br />
*:: APIGraphic.h code<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex, class I = Index><br />
class APICustomMesh : public iAPIGraphic, public APIBase {<br />
<br />
unsigned nSubsets; // number of subsets<br />
unsigned nPrimitives; // number of primitives<br />
unsigned* attribute; // points to mesh's attribute list<br />
I* index; // points to mesh's array of indices<br />
unsigned iIndex; // number of indices currently saved<br />
unsigned nIndices; // number of indices in the mesh<br />
T* vertex; // points to mesh's array of vertices<br />
unsigned iVertex; // number of vertices currently saved<br />
unsigned nVertices; // number of vertices in the mesh<br />
LPD3DXMESH apiMesh; // set of vertices, indices<br />
<br />
protected:<br />
virtual ~APICustomMesh();<br />
void setup();<br />
<br />
public:<br />
APICustomMesh(unsigned*, int, int, int, int);<br />
APICustomMesh(const APICustomMesh& v); <br />
APICustomMesh& operator=(const APICustomMesh& v);<br />
APICustomMesh* clone() const { return new APICustomMesh(*this); }<br />
unsigned add(const T& v);<br />
void add(unsigned);<br />
void draw(unsigned);<br />
void suspend();<br />
void release() { suspend(); }<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::APICustomMesh(unsigned* a, int np, int ni, int nv, int ns)<br />
: nSubsets(ns), nPrimitives(np), nIndices(ni), nVertices(nv), iIndex(0),<br />
iVertex(0) {<br />
<br />
attribute = new unsigned[nPrimitives];<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
attribute[i] = a[i];<br />
<br />
index = new I[nIndices];<br />
vertex = new T[nVertices];<br />
<br />
apiMesh = nullptr;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - add()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
unsigned APICustomMesh<T, I>::add(const T& v) {<br />
<br />
unsigned i = iVertex;<br />
<br />
if (vertex && iVertex < nVertices)<br />
vertex[iVertex++] = v;<br />
<br />
return i;<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::add(unsigned v) {<br />
<br />
if (index && iIndex < nIndices)<br />
index[iIndex++] = v;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::setup() {<br />
<br />
T *pv;<br />
I *pi;<br />
DWORD *pa;<br />
nIndices = iIndex;<br />
nVertices = iVertex;<br />
<br />
// create an empty mesh and lock its buffers<br />
if (FAILED(D3DXCreateMesh(nPrimitives, nVertices, 0,<br />
APIVertexDeclaration<T>::format(), d3dd, &apiMesh))) {<br />
error(L"APIMesh::14 Couldn\'t create the empty mesh");<br />
apiMesh = nullptr;<br />
}<br />
else if (FAILED(apiMesh->LockVertexBuffer(0, (void**)&pv))) {<br />
error(L"APIMesh::15 Couldn\'t lock vertex buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockIndexBuffer(0, (void**)&pi))) {<br />
error(L"APIMesh::16 Couldn\'t lock index buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockAttributeBuffer(0, &pa))) {<br />
error(L"APIMesh::17 Couldn\'t lock attribute buffer");<br />
release();<br />
}<br />
else {<br />
// populate the newly created Vertex Buffer<br />
for (unsigned i = 0; i < nVertices; i++)<br />
vertex[i].populate((void**)&pv);<br />
apiMesh->UnlockVertexBuffer();<br />
// populate the newly created Index Buffer<br />
for (unsigned i = 0; i < nIndices; i++)<br />
pi[i] = index[i];<br />
apiMesh->UnlockIndexBuffer();<br />
// Populate the newly created Attribute Buffer<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
pa[i] = attribute[i];<br />
apiMesh->UnlockAttributeBuffer();<br />
}<br />
}</syntaxhighlight><br />
*:: APIGraphic.cpp - DrawSubset()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::draw(unsigned iSubset) {<br />
<br />
// if mesh doesn't exist, set it up first<br />
if (!apiMesh) setup();<br />
<br />
if (apiMesh)<br />
apiMesh->DrawSubset(iSubset);<br />
}<br />
</syntaxhighlight><br />
*::: DrawIndexedPrimitive parameters<br />
*:: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::suspend() {<br />
<br />
// release the interface to the mesh<br />
if (apiMesh) {<br />
apiMesh->Release();<br />
apiMesh = nullptr;<br />
}<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - ~APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::~APICustomMesh() {<br />
<br />
release();<br />
if (attribute)<br />
delete [] attribute;<br />
if (index)<br />
delete [] index;<br />
if (vertex)<br />
delete [] vertex;<br />
}<br />
</syntaxhighlight><br />
*: X File<br />
*:: Create Mesh from File<br />
* SkyBox<br />
*: definition of a skybox<br />
*:: attachment to camera<br />
*:: inverted coordinates<br />
*: skybox textures<br />
*: Graphic.cpp code<br />
*: more complicated forms - skydome<br />
* Billboards<br />
*: definition, purpose of a billboard<br />
<syntaxhighlight lang="cpp"><br />
void Billboard::render(unsigned) {<br />
<br />
Vector h, u, r, p = position();<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector cameraPosition = camera->position();<br />
Vector cameraHeading = ::normal(camera->orientation('z'));<br />
Vector cameraUp = ::normal(camera->orientation('y'));<br />
switch (type) {<br />
// ... see below<br />
}<br />
Matrix rot(r.x, r.y, r.z, 0,<br />
u.x, u.y, u.z, 0,<br />
h.x, h.y, h.z, 0,<br />
0, 0, 0, 1);<br />
orient(rot);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
*: types of billboards<br />
*:: screen-aligned - useful for annotation text, lens flares<br />
*::: normal is opposite to camera heading<br />
*::: up is camera->up<br />
<syntaxhighlight lang="cpp"><br />
case SCREEN:<br />
h = cameraHeading; // fixed<br />
u = cameraUp; // up is fixed <br />
r = cross(u, h);<br />
break;<br />
</syntaxhighlight><br />
*:: axial - useful for cylindrical symmetry - trees (textured object does not face straight on)<br />
*::: up is fixed<br />
*::: normal faces the viewer as much as possible<br />
<syntaxhighlight lang="cpp"><br />
case AXIAL:<br />
h = ::normal(position() - cameraPosition); // heading is open to change<br />
u = Vector(0, 1, 0); // up axis is fixed<br />
r = cross(u, h);<br />
h = cross(u, r);<br />
break;<br />
</syntaxhighlight><br />
*:: view_plane - no distortion - useful for<br />
*::: normal is fixed (opposite to camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEW_PLANE:<br />
h = cameraHeading; // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*:: viewpoint - simulates distortion due to perspective projection - useful for clouds<br />
*::: normal is fixed (difference between viewpoint position and camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEWPOINT:<br />
h = ::normal(position() - cameraPosition); // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*: Object.h and Object.cpp code<br />
* Texture Filtering<br />
*: mip maps<br />
*:: multum in parvo<br />
*:: texture creation<br />
*:: APITexture::SetSamplerState()<br />
<syntaxhighlight lang="cpp"><br />
// mipmap filtering<br />
if (flags & TEX_MIPMAP)<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);<br />
else<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_NONE);<br />
</syntaxhighlight><br />
* DirectX Errors<br />
*: DirectX Utilities - Lookup Tool<br />
*: APIDisplay::restore() example<br />
<syntaxhighlight lang="cpp"><br />
bool APIDisplay::restore() {<br />
<br />
bool rc = false;<br />
<br />
if (d3dd) {<br />
HRESULT hr;<br />
hr = d3dd->TestCooperativeLevel();<br />
if (hr == D3DERR_DEVICENOTRESET)<br />
// reset the APIDisplay device<br />
rc = d3dd->Reset(&d3dpp) == D3D_OK;<br />
else if (hr == S_OK)<br />
rc = true;<br />
}<br />
if (rc) {<br />
// reacquire sprite manager references to video memory<br />
if (manager)<br />
manager->OnResetDevice();<br />
}<br />
<br />
// complete the restoration<br />
if (rc) {<br />
setupLighting();<br />
setupBlending();<br />
}<br />
<br />
return rc;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* meshes sample<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 Rob Whitaker on Skyboxes]<br />
* [http://web.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/suman_wk8_IBR.pdf Image Based Rendering - Suman Nadella on Billboarding and Imposters]<br />
* [http://www.digitalrune.com/Products/GameEngine/Particles.aspx DigitalRune]<br />
* [http://en.wikipedia.org/wiki/Mipmap Wikipedia on Texture Filtering]<br />
* [http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx D3D 9 tutorial on modeling with an Index list]<br />
<br />
== Week 5 - Feb 6 ==<br />
=== This Week ===<br />
* Vertex Declarations<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172559%28v=vs.85%29.aspx FVF Codes]<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex><br />
class APIVertexDeclaration {<br />
<br />
static D3DVERTEXELEMENT9 fmt[MAXD3DDECLLENGTH + 1];<br />
static unsigned vertexSize;<br />
<br />
public:<br />
static D3DVERTEXELEMENT9* format() { return fmt; }<br />
static unsigned size() { return vertexSize; }<br />
};<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<Vertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_NORMAL, 0},<br />
{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_TEXCOORD, 0}, <br />
D3DDECL_END()};<br />
<br />
template<><br />
unsigned APIVertexDeclaration<Vertex>::vertexSize = 32;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
<br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<LitVertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_COLOR, 0},<br />
D3DDECL_END()};<br />
<br />
template <><br />
unsigned APIVertexDeclaration<LitVertex>::vertexSize = 16;<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172630%28v=vs.85%29.aspx D3DVERTEXELEMENT9 struct]<br />
* The Pipeline<br />
*: [http://en.wikipedia.org/wiki/Instruction_pipeline What is a pipeline]<br />
*:<br />
* The GPU<br />
*: [http://en.wikipedia.org/wiki/Graphics_processing_unit What is a GPU]<br />
** nVidia<br />
**: [http://en.wikipedia.org/wiki/Geforce GeForce]<br />
**: [http://en.wikipedia.org/wiki/NVIDIA_Quadro Quadro]<br />
**: [http://en.wikipedia.org/wiki/Nvidia_Tesla Tesla]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units Comparison]<br />
** AMD (previously ATI)<br />
**: [http://en.wikipedia.org/wiki/Radeon_R520 Radeon 520]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_AMD_graphics_processing_units Comparison]<br />
* Shader Languages<br />
*: [http://en.wikipedia.org/wiki/Shader what is a shader]<br />
*: dedicated shaders<br />
*: [http://en.wikipedia.org/wiki/Unified_shader_model unified shaders]<br />
*: how does a shader work<br />
** Languages<br />
**: [http://en.wikipedia.org/wiki/HLSL HLSL - Microsoft]<br />
**: [http://en.wikipedia.org/wiki/Cg_%28programming_language%29 Cg - nVidia]<br />
**: [http://en.wikipedia.org/wiki/GLSL GLSL - OpenGL (Khronos)]<br />
* Vertex Shaders<br />
* Pixel Shaders<br />
* effect of skybox and point light on frame rate<br />
<br />
=== To Do ===<br />
<br />
== Week 6 - Feb 13 ==<br />
=== This Week ===<br />
==== Vertex Shader Programming ====<br />
* Host<br />
: APIPlatformSettings.h - Vertex Shader Identification - select between fixed function and programmable pipelines here<br />
<syntaxhighlight lang="cpp"><br />
// shader file data<br />
#define VERTEX_SHADER_FILE L"vertexShader.hlsl"<br />
#define VERTEX_SHADER_ENTRY_POINT "vertexShader"<br />
</syntaxhighlight><br />
: APIBase.h - pointers into the shader - APIBase is the base class for the graphics API classes<br />
<syntaxhighlight lang="cpp"><br />
static IDirect3DVertexShader9* vertexShader; // vertex shader<br />
static ID3DXConstantTable* uniformVS; // for vertex shader<br />
</syntaxhighlight><br />
: APIBase.cpp - initialize the shader pointers<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DVertexShader9* APIBase::vertexShader = nullptr; // vertex shader<br />
ID3DXConstantTable* APIBase::uniformVS = nullptr; // for vertex shader<br />
</syntaxhighlight><br />
: APIDisplay.h - keeps track of the current projection matrix<br />
<syntaxhighlight lang="cpp"><br />
Matrix projection; // projection transformation<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup() - checks the shader version<br />
<syntaxhighlight lang="cpp"><br />
// points to compiled shader code<br />
LPD3DXBUFFER compiledCodeVS = nullptr;<br />
<br />
// check for minimum vertex shader version required<br />
if (caps.VertexShaderVersion < D3DVS_VERSION(2,0))<br />
error(L"APIDisplay::09 Device does not support vertex shader 2_0");<br />
</syntaxhighlight><br />
compiles the shader hlsl code, retrieves address of constant memory and vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// compile the vertex shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(VERTEX_SHADER_FILE, NULL,<br />
NULL, VERTEX_SHADER_ENTRY_POINT, D3DXGetVertexShaderProfile(d3dd),<br />
D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION,<br />
&compiledCodeVS, NULL, &uniformVS))) {<br />
release();<br />
error(L"APIDisplay::13 Unable to compile vertex shader");<br />
}<br />
// create the vertex shader object<br />
else if (FAILED(d3dd->CreateVertexShader(<br />
(DWORD*)compiledCodeVS->GetBufferPointer(), &vertexShader))) {<br />
compiledCodeVS->Release();<br />
release();<br />
error(L"APIDisplay::14 Unable to create vertex shader object");<br />
}<br />
else {<br />
compiledCodeVS->Release();<br />
</syntaxhighlight><br />
sets the current vertex shader<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetVertexShader(vertexShader);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setProjection() - stores the projection matrix<br />
<syntaxhighlight lang="cpp"><br />
this->projection = *((Matrix*)projection);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginDrawFrame() - copies the view matrix and the camera heading to constant memory<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewProjection = v * projection;<br />
uniformVS->SetMatrix(d3dd, "viewProjection",<br />
(D3DXMATRIX*)&viewProjection);<br />
Vector heading(v.m13, v.m23, v.m33);<br />
// Required for specular lighting calculations<br />
uniformVS->SetFloatArray(d3dd, "heading", (FLOAT*)&heading, 3);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformVS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformVS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - set() - copies the lighting state to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setWorld() - copies the world matrix to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetMatrix(d3dd, "world", (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity() - copies the reflectivity to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformVS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release() - releases constant memory and the vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// release the shader COM objects<br />
if (uniformVS) {<br />
uniformVS->Release();<br />
uniformVS = nullptr;<br />
}<br />
if (vertexShader) {<br />
vertexShader->Release();<br />
vertexShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APILight.cpp - setup() - copies the light properties to constant memory<br />
<syntaxhighlight lang="cpp"><br />
// Populate the vertex shader constant table<br />
//<br />
// Light descriptors within the vertex shader<br />
char typ[] = "light[0].type";<br />
char amb[] = "light[0].ambient";<br />
char dif[] = "light[0].diffuse";<br />
char spe[] = "light[0].specular";<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
char spt[] = "light[0].spot";<br />
char att[] = "light[0].attenuation";<br />
char ran[] = "light[0].range";<br />
//<br />
// Reset index in light descriptor<br />
typ[6] = index + '0';<br />
amb[6] = index + '0';<br />
dif[6] = index + '0';<br />
spe[6] = index + '0';<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
spt[6] = index + '0';<br />
att[6] = index + '0';<br />
ran[6] = index + '0';<br />
// Populate the vertex shader constant table<br />
Vector attenuation(attenuation0, attenuation1, attenuation2);<br />
Vector spot(cosf(phi/2), cosf(theta/2), falloff);<br />
Vector zero;<br />
uniformVS->SetInt(d3dd, typ, type);<br />
uniformVS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformVS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformVS->SetFloat(d3dd, ran, range);<br />
rc = true;<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn() - repositions the light and turns it on<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update() - repositions the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff() - turns off the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
uniformVS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APIGraphic.h - class APIXMesh - processes an X file mesh<br />
<syntaxhighlight lang="cpp"><br />
D3DXCOLOR* ambient;<br />
D3DXCOLOR* diffuse;<br />
D3DXCOLOR* specular;<br />
FLOAT* power;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - copy constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - operator=() = assignment operator<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
ambient = new D3DXCOLOR[src.nSubsets];<br />
diffuse = new D3DXCOLOR[src.nSubsets];<br />
specular = new D3DXCOLOR[src.nSubsets];<br />
power = new FLOAT[src.nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
ambient[i] = src.ambient[i];<br />
diffuse[i] = src.diffuse[i];<br />
specular[i] = src.specular[i];<br />
power[i] = src.power[i];<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - setup() -<br />
<syntaxhighlight lang="cpp"><br />
ambient = new D3DXCOLOR[nSubsets];<br />
diffuse = new D3DXCOLOR[nSubsets];<br />
specular = new D3DXCOLOR[nSubsets];<br />
power = new FLOAT[nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
ambient[i].r = matl[i].MatD3D.Diffuse.r * 0.7f;<br />
ambient[i].g = matl[i].MatD3D.Diffuse.g * 0.7f;<br />
ambient[i].b = matl[i].MatD3D.Diffuse.b * 0.7f;<br />
ambient[i].a = matl[i].MatD3D.Diffuse.a;<br />
diffuse[i] = matl[i].MatD3D.Diffuse; // reflected from lights<br />
specular[i] = matl[i].MatD3D.Specular; // shine from lights<br />
power[i] = matl[i].MatD3D.Power; // 0 if it shouldn't be shiny<br />
</syntaxhighlight><br />
: APIGraphic.cpp - draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformVS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawVertex holds the untransformed data for a single vertex<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for a single vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float4 colour : COLOR; // colour of the lit vertex<br />
float2 texCoord0 : TEXCOORD0; // texture coordinates - stage 0<br />
float2 texCoord1 : TEXCOORD1; // texture coordinates - stage 1<br />
};<br />
<br />
// Uniform Data (constant for a stream of vertices)<br />
//<br />
// Lighting<br />
float4 ambient; // global ambient light - always on<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // switches for static lights<br />
Material material; // material reflectivity<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw vertex and returns the transformed vertex<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed;<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
<br />
// not working<br />
if (litVertex) {<br />
transformed.colour.r = raw.normal.r;<br />
transformed.colour.g = raw.normal.g;<br />
transformed.colour.b = raw.normal.b;<br />
transformed.colour.a = 1.0f;<br />
}<br />
else {<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
<br />
// Determine the colour of the vertex from each light in turn<br />
//<br />
// Use the cosine of the angle between the worldNormal and the direction<br />
// of the light to determine the amount of reflected light. The cosine<br />
// is given by the dot product, if both vectors have been normalized. If<br />
// the cosine is less than 0, the angle is greater than 90 degrees and<br />
// no light is reflected. Use saturate() to implement this condition.<br />
//<br />
// A more efficient algorithm would supply the light direction already<br />
// converted to the local space of the vertex (by using the inverse of<br />
// the world transformation).<br />
//<br />
<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
float3 lightDirection, camera = normalize(heading);<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
<br />
for (int i = 0; i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
lightDirection = - normalize((light[i].type == POINT_LIGHT)?<br />
float3(worldPosition.x, worldPosition.y, worldPosition.z) -<br />
light[i].position : light[i].direction);<br />
diffuseFactor = saturate(dot(worldNormal, lightDirection));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
worldNormal - lightDirection), camera));<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length((float3)worldPosition - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(worldPosition.x, worldPosition.y,<br />
worldPosition.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(<br />
abs((rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit vertex<br />
//<br />
transformed.colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
<br />
// pass the diffuse alpha along as the alpha component<br />
//<br />
transformed.colour.w = material.diffuse.w;<br />
}<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord0 = raw.texCoord;<br />
transformed.texCoord1 = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
<br />
==== Fragment Shader ====<br />
* Host<br />
: APIPlatformSettings.h<br />
<syntaxhighlight lang="cpp"><br />
#define FRAGMENT_SHADER_FILE L"fragmentShader.hlsl"<br />
#define FRAGMENT_SHADER_ENTRY_POINT "fragmentShader"<br />
</syntaxhighlight><br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
// Fragment Shader Support<br />
static IDirect3DPixelShader9* fragmentShader; // fragment shader<br />
static ID3DXConstantTable* uniformFS; // for fragment shader<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DPixelShader9* APIBase::fragmentShader = nullptr; // fragment shader<br />
ID3DXConstantTable* APIBase::uniformFS = nullptr; // for fragment shader<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER compiledCodeFS = nullptr;<br />
<br />
// checks for minimum pixel shader version required<br />
else if (caps.PixelShaderVersion < D3DPS_VERSION(3,0))<br />
error(L"Display::10 Device does not support pixel shader 3_0");<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// compile the fragment shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(FRAGMENT_SHADER_FILE, NULL,<br />
NULL, FRAGMENT_SHADER_ENTRY_POINT, D3DXGetPixelShaderProfile(d3dd), 0,<br />
&compiledCodeFS, NULL, &uniformFS))) {<br />
release();<br />
error(L"APIDisplay::15 Unable to compile the fragment shader code");<br />
}<br />
// create the pixel shader object<br />
else if (FAILED(d3dd->CreatePixelShader(<br />
(DWORD*)compiledCodeFS->GetBufferPointer(), &fragmentShader))) {<br />
compiledCodeFS->Release();<br />
release();<br />
error(L"APIDisplay::16 Unable to create fragment shader object");<br />
}<br />
else {<br />
compiledCodeFS->Release();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172732%28v=vs.85%29.aspx D3DXCompileShaderFromFile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172870%28v=vs.85%29.aspx D3DXGetPixelShaderProfile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::CreatePixelShader()]<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetPixelShader(fragmentShader);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::SetPixelShader()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformFS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformFS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205775%28v=vs.85%29.aspx ID3DXConstantTable::SetFloatArray()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205776%28v=vs.85%29.aspx ID3DXConstantTable::SetInt()]<br />
: APIDisplay.cpp - set()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205771%28v=vs.85%29.aspx ID3DXConstantTable::SetBool()]<br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformFS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
}<br />
if (uniformFS) {<br />
uniformFS->Release();<br />
uniformFS = nullptr;<br />
}<br />
if (fragmentShader) {<br />
fragmentShader->Release();<br />
fragmentShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh::draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformFS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205774%28v=vs.85%29.aspx ID3DXConstantTable::SetFloat()]<br />
: APILight.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetInt(d3dd, typ, type);<br />
uniformFS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformFS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformFS->SetFloat(d3dd, ran, range);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APITexture.cpp - attach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, true);<br />
</syntaxhighlight><br />
: APITexture.cpp - detach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, false);<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 viewPoint; // camera viewpoint for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define MTEXTURES 2<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of active lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
bool lighting; // lighting calculations on?<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - fragmentShader()<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
}<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
* reorganize framework code so that vertex shader receives product of world, view, and projection matrices<br />
** store viewProjection matrix as an instance variable in APIDisplay<br />
** pre-multiply viewProjection by world to obtain composite matrix to pass to vertex shader<br />
** add composite matrix to the constant table in the vertex shader<br />
* reorganize framework code to minimize duplication of heading normalization<br />
** perform normalization of heading in APIDisplay::beginDrawFrame()<br />
<br />
=== Resources ===<br />
<br />
== Week 7 - Feb 20 ==<br />
=== This Week ===<br />
* Effects Framework<br />
** techniques<br />
*: passes<br />
* Source Code<br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
static ID3DXEffect* effect; // points to effects framework<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
ID3DXEffect* APIBase::effect = nullptr; // effects framework<br />
</syntaxhighlight><br />
: APIDisplay.h<br />
<syntaxhighlight lang="cpp"><br />
// Effects Framework handles<br />
D3DXHANDLE viewProjection; // view * projection<br />
D3DXHANDLE viewPoint; // camera viewpoint<br />
D3DXHANDLE ambient; // global ambient color<br />
D3DXHANDLE ambientHandle; // current ambient reflectivity<br />
D3DXHANDLE diffuseHandle; // current diffuse reflectivity<br />
D3DXHANDLE specularHandle; // current specular reflectivity<br />
D3DXHANDLE powerHandle; // current shininess coefficient<br />
D3DXHANDLE worldHandle; // current world transformation<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
void beginEffect(const char*, unsigned&);<br />
void beginPass(unsigned);<br />
void endPass();<br />
void endEffect();<br />
</syntaxhighlight><br />
: APIDisplay.cpp - APIDisplay()<br />
<syntaxhighlight lang="cpp"><br />
viewProjection = nullptr;<br />
viewPoint = nullptr;<br />
ambient = nullptr;<br />
ambientHandle = nullptr;<br />
diffuseHandle = nullptr;<br />
specularHandle = nullptr;<br />
powerHandle = nullptr;<br />
worldHandle = nullptr;<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER errorBuffer = NULL;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// create the effects framework<br />
else if (FAILED(D3DXCreateEffectFromFile(d3dd, EFFECT_FILE, 0,<br />
0, D3DXSHADER_DEBUG, 0, &effect, &errorBuffer))) {<br />
release();<br />
error(L"APIDisplay::17 Unable to create the effects framework");<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172768%28v=vs.85%29.aspx D3DXCreateEffectFromFile()]<br />
<syntaxhighlight lang="cpp"><br />
if (errorBuffer) errorBuffer->Release();<br />
viewProjection = effect->GetParameterByName(0, "viewProjection");<br />
viewPoint = effect->GetParameterByName(0, "viewPoint");<br />
ambient = effect->GetParameterByName(0, "ambient");<br />
worldHandle = effect->GetParameterByName(0, "world");<br />
ambientHandle = effect->GetParameterByName(0, "material.ambient");<br />
diffuseHandle = effect->GetParameterByName(0, "material.diffuse");<br />
specularHandle = effect->GetParameterByName(0, "material.specular");<br />
powerHandle = effect->GetParameterByName(0, "material.power");<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205696%28v=vs.85%29.aspx GetParameterByName()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewprojection = v * projection;<br />
Vector heading(v.m13, v.m23, v.m33);<br />
effect->SetMatrix(viewProjection, (D3DXMATRIX*)&viewprojection);<br />
effect->SetVector(viewPoint, (D3DXVECTOR4*)&heading);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205720%28v=vs.85%29.aspx SetMatrix()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205729%28v=vs.85%29.aspx SetVector()]<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
effect->SetVector(ambient, (D3DXVECTOR4*)&colour);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginEffect(const char* technique, unsigned& nPasses) {<br />
<br />
D3DXHANDLE techniqueHandle = effect->GetTechniqueByName(technique);<br />
effect->SetTechnique(techniqueHandle);<br />
effect->Begin(&nPasses, 0);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205706%28v=vs.85%29.aspx GetTechniqueByName()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205834%28v=vs.85%29.aspx SetTechnique()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205815%28v=vs.85%29.aspx Begin()]<br />
: APIDisplay.cpp - beginPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginPass(unsigned i) {<br />
<br />
effect->BeginPass(i);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205817%28v=vs.85%29.aspx BeginPass()]<br />
: APIDisplay.cpp - endPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endPass() {<br />
<br />
effect->EndPass();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205823%28v=vs.85%29.aspx EndPass()]<br />
: APIDisplay.cpp - endEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endEffect() {<br />
<br />
effect->End();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205821%28v=vs.85%29.aspx End()]<br />
: APIDisplay.cpp - setWorld()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetMatrix(worldHandle, (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetVector(ambientHandle, (D3DXVECTOR4*)&r.ambient);<br />
effect->SetVector(diffuseHandle, (D3DXVECTOR4*)&r.diffuse);<br />
effect->SetVector(specularHandle, (D3DXVECTOR4*)&r.specular);<br />
effect->SetFloat(powerHandle, r.power);<br />
effect->CommitChanges();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205819%28v=vs.85%29.aspx CommitChanges()]<br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
if (effect) {<br />
effect->Release();<br />
effect = NULL;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float3 ambient; <br />
float3 diffuse;<br />
float3 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of static lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float4 viewPoint; // camera viewpoint for specular calcs<br />
// Geometry<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: effects.fx - VertexShader<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - FragmentShader<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - technique opaque<br />
<syntaxhighlight lang="cpp"><br />
technique opaque {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - technique translucent<br />
<syntaxhighlight lang="cpp"><br />
technique translucent {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
</syntaxhighlight><br />
=== To Do ===<br />
=== Resources ===<br />
<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* Frank Luna's notes for DirectX10 (page 306)<br />
:[http://books.google.ca/books?id=AyACb-t8E-MC&pg=PA306&lpg=PA306#v=onepage&q&f=false Environment Maps](Google books)<br />
:[http://libcat.senecac.on.ca/vwebv/holdingsInfo?searchId=19588&recCount=50&recPointer=2&bibId=261220 Environment Maps](Seneca ELibraray) <br />
* Design.cpp<br />
: Design::initialize() - create the skybox object<br />
<syntaxhighlight lang="cpp"><br />
// initialize initializes the general display design coordinator, creates the<br />
// primitive sets, textures, objects, lights, sounds, cameras, and text items<br />
//<br />
void Design::initialize() {<br />
<br />
// ...<br />
<br />
// create textures<br />
iTexture* sunset = CreateCubeTexture(L"Islands.dds");<br />
<br />
// ...<br />
<br />
iObject* skybox = CreateSkybox();<br />
skybox->rotatex(-1.5708f);<br />
skybox->attach(sunset);<br />
setSkybox(skybox);<br />
<br />
// ...<br />
}<br />
</syntaxhighlight><br />
* Coordinator.cpp<br />
: Coordinator::render() - using different techniques for different objects<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render() {<br />
<br />
// adjust framecount and fps<br />
if (now - lastReset <= unitsPerSec)<br />
framecount++;<br />
else {<br />
// recalculate the frame rate<br />
fps = framecount * unitsPerSec / (now - lastReset);<br />
framecount = 0;<br />
lastReset = now;<br />
if (timerText) {<br />
wchar_t str[MAX_DESC + 1];<br />
sprintf(str, fps, L" fps");<br />
timerText->set(str);<br />
}<br />
}<br />
// update the user input devices<br />
userInput->update();<br />
Coordinator::update();<br />
// update the model<br />
update();<br />
// update the audio<br />
audio->setVolume(volume);<br />
audio->setFrequencyRatio(frequency);<br />
audio->update(Camera::getView());<br />
<br />
// start rendering<br />
display->beginDrawFrame(Camera::getView());<br />
display->setAmbientLight(ambient.r, ambient.g, ambient.b);<br />
unsigned nPasses;<br />
// render all of the opaque unlit objects<br />
display->beginEffect("opaque", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(OPAQUE_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the translucent unlit objects<br />
display->beginEffect("translucent", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(TRANSLUCENT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the lit objects<br />
display->beginEffect("litObjects", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(LIT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render the skybox<br />
display->beginEffect("skybox", nPasses);<br />
if (background && !skybox) {<br />
Rectf fullScreen(0, 0, 1, 1);<br />
display->beginDrawHUD(0);<br />
background->render(fullScreen, true);<br />
display->endDrawHUD();<br />
}<br />
else if (skybox) {<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(SKYBOX);<br />
display->endPass();<br />
}<br />
}<br />
display->endEffect();<br />
display->set(ALPHA_BLEND, false);<br />
display->beginDrawHUD(HUD_ALPHA);<br />
render(ALL_HUDS);<br />
display->endDrawHUD();<br />
display->endDrawFrame();<br />
render(ALL_SOUNDS);<br />
}<br />
</syntaxhighlight><br />
: Coordinator::render(iObject*) - render a single object one subset at a time<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render(iObject* object) {<br />
<br />
display->setWorld(&object->world());<br />
unsigned nSubsets = object->noSubsets();<br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
iTexture* texture = object->getTexture(i);<br />
if (texture) texture->attach();<br />
display->setReflectivity(object->getReflectivity(i));<br />
object->render(i);<br />
if (texture) texture->detach();<br />
}<br />
}<br />
</syntaxhighlight><br />
* Skybox class<br />
: iObject interface - CreateSkybox declaration<br />
<syntaxhighlight lang="cpp"><br />
class iObject : public Shape, public Base {<br />
public:<br />
// initialization<br />
virtual void attach(iTexture* t) = 0;<br />
virtual void attach(iTexture** t) = 0;<br />
// execution<br />
virtual unsigned noSubsets() const = 0;<br />
virtual void render(unsigned) = 0;<br />
virtual void setTextureFilter(unsigned) = 0;<br />
virtual iTexture* getTexture(unsigned) const = 0;<br />
virtual const void* getReflectivity(unsigned) const = 0;<br />
virtual bool belongsTo(Category category) const = 0;<br />
};<br />
<br />
iObject* CreateObject(iGraphic*, const Reflectivity* = nullptr, unsigned = 1u);<br />
iObject* CreateBillboard(BillboardType, iGraphic*,<br />
const Reflectivity* = nullptr);<br />
iObject* CreateSkybox();<br />
<br />
iObject* Clone(const iObject*);<br />
</syntaxhighlight><br />
: Skybox class - derived from Object<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
// A Skybox is an inverted Object that translates with the viewpoint<br />
//<br />
class Skybox : public Object {<br />
<br />
public:<br />
Skybox();<br />
void render(unsigned);<br />
};<br />
</syntaxhighlight><br />
: CreateSkybox<br />
<syntaxhighlight lang="cpp"><br />
iObject* CreateSkybox() {<br />
<br />
return new Skybox();<br />
}<br />
</syntaxhighlight><br />
: Skybox::Skybox - SKYBOX category, 2 x 2 x 2 cube<br />
<syntaxhighlight lang="cpp"><br />
Skybox::Skybox() : Object(SKYBOX, CreateIBox(-1, -1, -1 * MODEL_Z_AXIS, 1, 1,<br />
1 * MODEL_Z_AXIS)) {<br />
}<br />
</syntaxhighlight><br />
: Skybox::render(unsigned) - move skybox centroid to current camera position<br />
<syntaxhighlight lang="cpp"><br />
void Skybox::render(unsigned) {<br />
<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector disp = camera->position() - position();<br />
translate(disp.x, disp.y, disp.z);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
* Texture class<br />
: iTexture interface - CreateCubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iTexture : public Base {<br />
public:<br />
virtual void attach() const = 0;<br />
virtual void setFilter(unsigned) const = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, bool = false) = 0;<br />
};<br />
<br />
iTexture* CreateTexture(const wchar_t* file, unsigned filter = 0);<br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter = 0);<br />
<br />
iTexture* Clone(const iTexture*);<br />
</syntaxhighlight><br />
: Texture class - add the cube parameter to constructor<br />
<syntaxhighlight lang="cpp"><br />
class Texture : public iTexture {<br />
<br />
iAPITexture* apiTexture; // points to the api texture<br />
<br />
Texture(const Texture&);<br />
virtual ~Texture();<br />
<br />
public:<br />
Texture(const wchar_t* file, unsigned filter = 0, bool cube = false);<br />
Texture& operator=(const Texture&);<br />
void* clone() const { return new Texture(*this); }<br />
// execution<br />
void attach() const;<br />
void setFilter(unsigned) const;<br />
void detach();<br />
void render(const Rectf&, bool);<br />
// termination<br />
void suspend();<br />
void release();<br />
};</syntaxhighlight><br />
: CreateCubeTexture - call constructor with true flag for cube<br />
<syntaxhighlight lang="cpp"><br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter) {<br />
<br />
return new Texture(file, filter, true);<br />
}<br />
</syntaxhighlight><br />
: Texture::Texture() - create APICubeTexture()<br />
<syntaxhighlight lang="cpp"><br />
Texture::Texture(const wchar_t* file, unsigned filter, bool cube) {<br />
<br />
coordinator->add(this);<br />
<br />
wchar_t* fileWithPath = nullptr;<br />
if (file) {<br />
// add the directory to create the relative filename<br />
int len = strlen(file) + strlen(TEXTURE_DIRECTORY) + 1;<br />
fileWithPath = new wchar_t[len + 1];<br />
::nameWithDir(fileWithPath, TEXTURE_DIRECTORY, file, len);<br />
}<br />
<br />
// apiTexture on the graphics device<br />
if (cube)<br />
apiTexture = CreateAPICubeTexture(fileWithPath);<br />
else<br />
apiTexture = CreateAPITexture(fileWithPath, filter);<br />
<br />
if (fileWithPath) delete [] fileWithPath;<br />
}<br />
</syntaxhighlight><br />
: iAPITexture interface - add CreateAPICubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iAPITexture {<br />
public:<br />
virtual iAPITexture* clone() const = 0;<br />
// execution<br />
virtual void attach() = 0;<br />
virtual void setFilter(unsigned flags) = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, unsigned char, bool = false) = 0;<br />
// termination<br />
virtual void suspend() = 0;<br />
virtual void release() = 0;<br />
virtual void Delete() const = 0;<br />
};<br />
<br />
iAPITexture* CreateAPITexture(const wchar_t* file, unsigned filter);<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file);<br />
</syntaxhighlight><br />
* APITexture.h<br />
: APICubeTexture class definition<br />
<syntaxhighlight lang="cpp"><br />
class APICubeTexture : public iAPITexture, public APIBase {<br />
<br />
wchar_t* file; // points to file with texture image<br />
unsigned filter; // default texture filtering flags<br />
<br />
IDirect3DCubeTexture9* tex; // interface to texture COM object<br />
<br />
virtual ~APICubeTexture();<br />
<br />
void setup();<br />
<br />
public:<br />
APICubeTexture(const wchar_t* file);<br />
APICubeTexture(const APICubeTexture&);<br />
iAPITexture& operator=(const APICubeTexture&);<br />
iAPITexture* clone() const { return new APICubeTexture(*this); }<br />
// execution<br />
void attach();<br />
void setFilter(unsigned filter) {}<br />
void detach();<br />
void render(const Rectf&, unsigned char, bool) {}<br />
// suspension<br />
void suspend();<br />
// termination<br />
void release();<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174329%28v=vs.85%29.aspx IDirect3DCubeTexture9 interface]<br />
: APICubeTexture class implementation<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- APICubeTexture -----------------------------<br />
//<br />
// The APICubeTexture class implements a texture at the API level<br />
//<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file) {<br />
<br />
return new APICubeTexture(file);<br />
}<br />
<br />
// constructor initializes the texture identifier<br />
//<br />
APICubeTexture::APICubeTexture(const wchar_t* file) {<br />
<br />
if (file) {<br />
int len = strlen(file);<br />
this->file = new wchar_t[len + 1];<br />
strcpy(this->file, file, len);<br />
}<br />
else<br />
this->file = nullptr;<br />
<br />
tex = nullptr;<br />
}<br />
<br />
APICubeTexture::APICubeTexture(const APICubeTexture& src) {<br />
<br />
file = nullptr;<br />
tex = nullptr;<br />
*this = src; <br />
}<br />
<br />
iAPITexture& APICubeTexture::operator=(const APICubeTexture& src) {<br />
<br />
if (this != &src) {<br />
if (file)<br />
delete [] file;<br />
if (src.file) {<br />
int len = strlen(src.file);<br />
file = new wchar_t[len + 1];<br />
strcpy(file, src.file, len);<br />
}<br />
else<br />
file = nullptr;<br />
suspend();<br />
tex = nullptr;<br />
}<br />
<br />
return *this;<br />
}<br />
<br />
// setup creates the api texture from the texture file<br />
//<br />
void APICubeTexture::setup() {<br />
<br />
// create a texture COM object from the texture file<br />
//<br />
HRESULT hr;<br />
if (file && FAILED(hr = D3DXCreateCubeTextureFromFileEx(d3dd, file,<br />
0, D3DX_DEFAULT, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT,<br />
D3DX_DEFAULT, 0, nullptr, nullptr, &tex))) {<br />
error(L"APICubeTexture::11 Failed to create texture COM object from file");<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// attach attaches the api texture to sampling stage i<br />
//<br />
void APICubeTexture::attach() {<br />
<br />
if (!tex) setup();<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, tex);<br />
}<br />
<br />
// detach detaches the api texture from sampling stage 0<br />
//<br />
void APICubeTexture::detach() {<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, nullptr);<br />
}<br />
<br />
// suspend releases the api texture<br />
//<br />
void APICubeTexture::suspend() {<br />
<br />
// release the Interface to the texture COM object<br />
if (tex) {<br />
tex->Release();<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// releases suspends the api texture<br />
//<br />
void APICubeTexture::release() {<br />
<br />
suspend();<br />
}<br />
<br />
// destructor releases the api texture<br />
//<br />
APICubeTexture::~APICubeTexture() {<br />
<br />
release();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172757%28v=vs.85%29.aspx D3DXCreateCubeTextureFromFileEx]<br />
* effects.fx<br />
: vertex shader outpu structure<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
struct FS_Skybox {<br />
float4 pos : POSITION;<br />
float3 tex : TEXCOORD0;<br />
};<br />
</syntaxhighlight><br />
: vertex shader<br />
<syntaxhighlight lang="cpp"><br />
FS_Skybox skyboxVertexShader(float3 pos : POSITION) {<br />
FS_Skybox output = (FS_Skybox) 0;<br />
output.pos = mul(float4(pos, 0), world); // Note the 0, this so the skybox rotates, but without translation<br />
output.pos = mul(output.pos, viewProjection).xyww; // The z coordinate is replaced by w, so that the point is always projected at infinity<br />
output.tex = pos.xzy; // Note that y and z are switched to match the texture coordinate system<br />
return output;<br />
}<br />
</syntaxhighlight><br />
: skybox sampler state<br />
<syntaxhighlight lang="cpp"><br />
texture skyBox;<br />
samplerCUBE skySampler = sampler_state {<br />
texture = <skyBox>;<br />
MagFilter = LINEAR;<br />
Minfilter = LINEAR;<br />
Mipfilter = LINEAR;<br />
AddressU = MIRROR;<br />
AddressV = MIRROR;<br />
AddressW = MIRROR;<br />
};<br />
</syntaxhighlight><br />
: fragment shader<br />
<syntaxhighlight lang="cpp"><br />
float4 skyboxFragmentShader(FS_Skybox input) : COLOR0 {<br />
return texCUBE(skySampler, input.tex);<br />
}<br />
</syntaxhighlight><br />
: skybox technique<br />
<syntaxhighlight lang="cpp"><br />
technique skybox {<br />
<br />
pass {<br />
AlphaBlendEnable = false;<br />
ZENABLE = true;<br />
ZWRITEENABLE = false; // By not storing the skybox's z-buffer value, it enables objects behind the skybox to be drawn, giving a realist look (e.g. an airplane in the distance)<br />
CullMode = None;<br />
VertexShader = compile vs_3_0 skyboxVertexShader();<br />
PixelShader = compile ps_3_0 skyboxFragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 RB Whitaker's notes on skyboxes]<br />
* [http://knol.google.com/k/3d-skybox# Koen Samyn's knol]<br />
* [http://www.gameengineer.net/samples-graphics.html Game Engineer's demo]<br />
* [http://www.planetside.co.uk/terragen Terragen Texture Tool]<br />
* DirectX Utility - DirectX Texture Tool<br />
<br />
<!--<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* [http://msdn.microsoft.com/en-us/library/bb147178%28v=VS.85%29.aspx Mathematics of Lighting]<br />
* Lighting in Vertex Shaders<br />
** Notation<br />
**: G<sub>a</sub> - global ambient color<br />
**: C<sub>a</sub> - material ambient color<br />
**: C<sub>d</sub> - material diffuse color<br />
**: C<sub>s</sub> - material specular color<br />
**: L<sub>a<sub>i</sub></sub> - ambient color of light i<br />
**: L<sub>d<sub>i</sub></sub> - diffuse color of light i<br />
**: L<sub>s<sub>i</sub></sub> - specular color of light i<br />
**: L<sub>dir<sub>i</sub></sub> - direction vector of light i<br />
**: N - normal to the surface at the vertex<br />
*** [http://msdn.microsoft.com/en-us/library/bb172279%28v=VS.85%29.aspx Attenuation and Spotlight Factors]<br />
**** Atten<sub>i</sub> - attenuation of light i<br />
***: d<sub>i</sub> - distance from light i<br />
***:: d<sub>i</sub> = |L<sub>dir<sub>i</sub></sub>|<br />
***: a<sub>0</sub> - constant attenuation factor<br />
***: a<sub>1</sub> - linear attenuation factor<br />
***: a<sub>2</sub> - quadratic attenuation factor<br />
***: Atten<sub>i</sub> = 1/(a<sub>0</sub> + a<sub>1</sub> d<sub>i</sub> + a<sub>2</sub> d<sub>i</sub><sup>2</sup>)<br />
***: Atten<sub>i</sub> = [0, 1]<br />
**** Spot<sub>i</sub> - spot factor of light i<br />
***: Spot<sub>i</sub> = {[r<sub>i</sub> - cos(phi<sub>i</sub>/2)]/[cos(theta<sub>i</sub>/2) - cos(phi<sub>i</sub>/2)]}<sup>f<sub>i</sub></sup><br />
***: r<sub>i</sub> - cosine of angle from axis of spotlight<sub>i</sub><br />
***:: r<sub>i</sub> = norm(- light direction in camera space) . norm(L<sub>dir<sub>i</sub></sub>)<br />
***: phi<sub>i</sub> - penumbra (exterior cone) angle of spotlight<sub>i</sub><br />
***: theta<sub>i</sub> - umbra (interior cone) angle of spotlight<sub>i</sub><br />
***: f<sub>i</sub> - falloff factor of spotlight<sub>i</sub><br />
** [http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model Blinn-Phong and Phong]<br />
**: V - viewpoint vector<br />
**:: V = norm(Camera<sub>position</sub> - Vertex<sub>position</sub>)<br />
** Phong - account accurately for position of viewer<br />
**: Specular reflectance = (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup><br />
**: R<sub>i</sub> - reflection vector<br />
**:: R<sub>i</sub> = 2 * (N . L<sub>dir<sub>i</sub></sub>) N - L<sub>dir<sub>i</sub></sub><br />
**: p<sub>i</sub> - true specular power of light i<br />
**:<br />
** Blinn-Phong - use halfway vector instead of reflection vector - adjust power to compensate<br />
**: Specular reflectance = (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup><br />
**: H<sub>i</sub> - halfway vector<br />
**:: H<sub>i</sub> = norm(V + L<sub>dir<sub>i</sub></sub>)<br />
**:: H<sub>i</sub> = norm([0,0,1] + L<sub>dir<sub>i</sub></sub>) - less computationally intensive - assumes that camera is at infinity along z axis<br />
**: p'<sub>i</sub> - adjusted specular power of light i<br />
**:<br />
** [http://msdn.microsoft.com/en-us/library/bb172256%28v=VS.85%29.aspx Ambient]<br />
**: C<sub>a</sub> * ( G<sub>a</sub> + sum [L<sub>a<sub>i</sub></sub> * Atten<sub>i</sub> * Spot<sub>i</sub>] )<br />
** [http://msdn.microsoft.com/en-us/library/bb219656%28v=VS.85%29.aspx Diffuse]<br />
**: C<sub>d</sub> * sum [ L<sub>d<sub>i</sub></sub> * (N . L<sub>dir<sub>i</sub></sub>) * Atten<sub>i</sub> * Spot<sub>i</sub> ]<br />
** [http://msdn.microsoft.com/en-us/library/bb147399%28VS.85%29.aspx Specular]<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Blinn-Phong<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Phong<br />
** [http://msdn.microsoft.com/en-us/library/ff471376%28v=vs.85%29.aspx HLSL Intrinsic Functions]<br />
*** [http://msdn.microsoft.com/en-us/library/bb509630%28v=vs.85%29.aspx normalize()] - normalize a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509594%28v=vs.85%29.aspx dot(,)] - dot product of two vectors of any size<br />
*** [http://msdn.microsoft.com/en-us/library/bb509617%28v=vs.85%29.aspx length()] - length of a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509645%28v=vs.85%29.aspx saturate()] - clamp scalar, vector, or matrix to [0, 1]<br />
=== To Do ===<br />
=== Resources ===<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=GAM670/DPS905_Weekly_Schedule_20121&diff=82687GAM670/DPS905 Weekly Schedule 201212012-03-09T14:29:05Z<p>Gbatumbya: /* This Week */</p>
<hr />
<div>{{GAM670/DPS905 Index | 20121}}<br />
= GAM670/DPS905 -- Weekly Schedule 20121=<br />
<br />
== Week 1 - Jan 8 ==<br />
<br />
=== This Week ===<br />
* Assignment Discussion<br />
* Suggested Enhancements<br />
* Review of the Base Code<br />
** Definition of a Framework<br />
*** Modularity through stable interfaces<br />
*** Re-usability through generic components<br />
*** Extensibility through hook methods<br />
*** Inversion of control - determines which application methods to invoke in response to external events<br />
** Framework Architecture<br />
*** Modelling Layer<br />
*** API Translation Layer<br />
** Notable Features of the Base Code<br />
** camera, sound, and light are also derived from the Frame class<br />
** textures attach at the object level<br />
** texture connection is uncoupled from drawing of the graphics primitives<br />
** reference frames are relative<br />
** very simple collision detection<br />
<br />
=== To Do ===<br />
<br />
# add your name to the student list<br />
# create a team page that includes the semester number 20121<br />
#* describe the game that you intend to develop<br />
#* list the topics of interest to your team in developing its game<br />
#* list the other topics of interest<br />
<!--<br />
# Port Game Design over to Update Base Code--><br />
<br />
=== Resources ===<br />
<br />
<br />
== Week 2 - Jan 16 ==<br />
<br />
=== This Week ===<br />
<br />
* Relative Reference Frames<br />
** Recursive calls<br />
**: Vector Frame::position()<br />
**: Matrix Frame::rotation()<br />
**: Matrix Frame::world()<br />
** Detaching from and attaching to a parent frame<br />
**: Frame::attachTo()<br />
* Geometry<br />
** Plane<br />
**: normal + constant - examples<br />
**: equation of a plane: dot(n, x) + D = 0<br />
**: positive side of a plane dot(n, x) + D > 0<br />
* Collision Detection<br />
*: types of colliders<br />
*:: spheres<br />
*:: planes<br />
*:: axis-aligned bounding boxes<br />
*:: oriented bounding boxes<br />
<br />
=== To Do ===<br />
* Research the feature that you are going to add and prepare a plan of action<br />
* Prepare a team page for your team so that repos can be ordered<br />
* Add a section to your team page to track your project and solicit commentary<br />
<br />
=== Resources ===<br />
<br />
== Week 3 - Jan 23 ==<br />
=== This Week ===<br />
* Collision Detection (cont'd)<br />
*: Shape<br />
*:: Shape : Frame<br />
*:: Shape::setRadius()<br />
*:: Shape::getRadius()<br />
*:: Shape::setRadius(float r);<br />
*:: Shape::setRadius(float x, float y, float z);<br />
*:: Shape::getRadius() const { return radius; }<br />
*:: Shape::setPlane(Vector n, float d);<br />
*:: Shape::setAxisAligned(Vector min, Vector max);<br />
* Comprehensive Camerawork<br />
*: rotation about an axis<br />
*: order of rotation matters<br />
*: Euler angles<br />
*:: [http://www.youtube.com/watch?v=UpSMNYTVqQI&feature=related 3-2-1 angles]<br />
*: gimbal lock<br />
*:: [http://www.youtube.com/watch?v=rrUCBOlJdt4&feature=related StephenSeefeld.net]<br />
*: complex numbers<br />
*:: solution of cubic equations 16th century<br />
*:: two-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers matrix representation]<br />
*: quaternions<br />
*:: extension of complex numbers<br />
*:: four-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Quaternion#Matrix_representations matrix representation]<br />
*: geometric algebra (more abstract)<br />
*:: [http://staff.science.uva.nl/~leo/cinderella/line1.html Dorst's site]<br />
*:: [http://sinai.apphy.u-fukui.ac.jp/gcj/software/GAcindy-1.4/GAcindy.htm Hitzer's site]<br />
* Visibility Determination<br />
**: test a point for presence within a set of planes<br />
**: normal calculations - general rotation matrix - vector and angle<br />
** ViewFrustum<br />
**: parameter - view * projection<br />
**: 6 planes<br />
**:: near and far planes<br />
**:: left and right planes<br />
**:: top and bottom planes<br />
**: coding<br />
**:: constructor<br />
**:: ViewFrustum::contains()<br />
** Finite Size of Objects<br />
**: Expansion of the View Frustum<br />
* Index Buffers<br />
*: amount of storage needed for vertex data<br />
*: duplication of vertex data<br />
*: indexing<br />
*: indexed primitives<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://en.wikipedia.org/wiki/Complex_number Wikipedia on Complex Numbers]<br />
* [http://en.wikipedia.org/wiki/Quaternion Wikipedia on Quaternions]<br />
* [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Wikipedia on quaternions and Spatial Rotations]<br />
* [http://mathworld.wolfram.com/Quaternion.html Wolfram on Quaternions]<br />
* [http://www.cprogramming.com/tutorial/3d/quaternions.html CProgramming.com on Quaternions]<br />
* [http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer Ogre intro on Quaternions]<br />
* collision sample<br />
* indexBuffering sample<br />
<br />
<br />
== Week 4 - Jan 30 ==<br />
=== This Week ===<br />
* Meshes<br />
*: What is a mesh?<br />
*:: vertex list -> vertex buffer<br />
*:: index list -> index buffer<br />
*:: attribute list -> subset to which primitives belong<br />
*:: pyramid sample<br />
*: Stock Objects<br />
*:: Sphere<br />
*::: slices and partitions<br />
*:: Cylinder<br />
*:: Torus<br />
*:: Utah Teapot<br />
*:: APIGraphic.h and .cpp code<br />
*: Custom Mesh<br />
*:: Create a Mesh<br />
*:: APIGraphic.h code<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex, class I = Index><br />
class APICustomMesh : public iAPIGraphic, public APIBase {<br />
<br />
unsigned nSubsets; // number of subsets<br />
unsigned nPrimitives; // number of primitives<br />
unsigned* attribute; // points to mesh's attribute list<br />
I* index; // points to mesh's array of indices<br />
unsigned iIndex; // number of indices currently saved<br />
unsigned nIndices; // number of indices in the mesh<br />
T* vertex; // points to mesh's array of vertices<br />
unsigned iVertex; // number of vertices currently saved<br />
unsigned nVertices; // number of vertices in the mesh<br />
LPD3DXMESH apiMesh; // set of vertices, indices<br />
<br />
protected:<br />
virtual ~APICustomMesh();<br />
void setup();<br />
<br />
public:<br />
APICustomMesh(unsigned*, int, int, int, int);<br />
APICustomMesh(const APICustomMesh& v); <br />
APICustomMesh& operator=(const APICustomMesh& v);<br />
APICustomMesh* clone() const { return new APICustomMesh(*this); }<br />
unsigned add(const T& v);<br />
void add(unsigned);<br />
void draw(unsigned);<br />
void suspend();<br />
void release() { suspend(); }<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::APICustomMesh(unsigned* a, int np, int ni, int nv, int ns)<br />
: nSubsets(ns), nPrimitives(np), nIndices(ni), nVertices(nv), iIndex(0),<br />
iVertex(0) {<br />
<br />
attribute = new unsigned[nPrimitives];<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
attribute[i] = a[i];<br />
<br />
index = new I[nIndices];<br />
vertex = new T[nVertices];<br />
<br />
apiMesh = nullptr;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - add()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
unsigned APICustomMesh<T, I>::add(const T& v) {<br />
<br />
unsigned i = iVertex;<br />
<br />
if (vertex && iVertex < nVertices)<br />
vertex[iVertex++] = v;<br />
<br />
return i;<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::add(unsigned v) {<br />
<br />
if (index && iIndex < nIndices)<br />
index[iIndex++] = v;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::setup() {<br />
<br />
T *pv;<br />
I *pi;<br />
DWORD *pa;<br />
nIndices = iIndex;<br />
nVertices = iVertex;<br />
<br />
// create an empty mesh and lock its buffers<br />
if (FAILED(D3DXCreateMesh(nPrimitives, nVertices, 0,<br />
APIVertexDeclaration<T>::format(), d3dd, &apiMesh))) {<br />
error(L"APIMesh::14 Couldn\'t create the empty mesh");<br />
apiMesh = nullptr;<br />
}<br />
else if (FAILED(apiMesh->LockVertexBuffer(0, (void**)&pv))) {<br />
error(L"APIMesh::15 Couldn\'t lock vertex buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockIndexBuffer(0, (void**)&pi))) {<br />
error(L"APIMesh::16 Couldn\'t lock index buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockAttributeBuffer(0, &pa))) {<br />
error(L"APIMesh::17 Couldn\'t lock attribute buffer");<br />
release();<br />
}<br />
else {<br />
// populate the newly created Vertex Buffer<br />
for (unsigned i = 0; i < nVertices; i++)<br />
vertex[i].populate((void**)&pv);<br />
apiMesh->UnlockVertexBuffer();<br />
// populate the newly created Index Buffer<br />
for (unsigned i = 0; i < nIndices; i++)<br />
pi[i] = index[i];<br />
apiMesh->UnlockIndexBuffer();<br />
// Populate the newly created Attribute Buffer<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
pa[i] = attribute[i];<br />
apiMesh->UnlockAttributeBuffer();<br />
}<br />
}</syntaxhighlight><br />
*:: APIGraphic.cpp - DrawSubset()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::draw(unsigned iSubset) {<br />
<br />
// if mesh doesn't exist, set it up first<br />
if (!apiMesh) setup();<br />
<br />
if (apiMesh)<br />
apiMesh->DrawSubset(iSubset);<br />
}<br />
</syntaxhighlight><br />
*::: DrawIndexedPrimitive parameters<br />
*:: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::suspend() {<br />
<br />
// release the interface to the mesh<br />
if (apiMesh) {<br />
apiMesh->Release();<br />
apiMesh = nullptr;<br />
}<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - ~APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::~APICustomMesh() {<br />
<br />
release();<br />
if (attribute)<br />
delete [] attribute;<br />
if (index)<br />
delete [] index;<br />
if (vertex)<br />
delete [] vertex;<br />
}<br />
</syntaxhighlight><br />
*: X File<br />
*:: Create Mesh from File<br />
* SkyBox<br />
*: definition of a skybox<br />
*:: attachment to camera<br />
*:: inverted coordinates<br />
*: skybox textures<br />
*: Graphic.cpp code<br />
*: more complicated forms - skydome<br />
* Billboards<br />
*: definition, purpose of a billboard<br />
<syntaxhighlight lang="cpp"><br />
void Billboard::render(unsigned) {<br />
<br />
Vector h, u, r, p = position();<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector cameraPosition = camera->position();<br />
Vector cameraHeading = ::normal(camera->orientation('z'));<br />
Vector cameraUp = ::normal(camera->orientation('y'));<br />
switch (type) {<br />
// ... see below<br />
}<br />
Matrix rot(r.x, r.y, r.z, 0,<br />
u.x, u.y, u.z, 0,<br />
h.x, h.y, h.z, 0,<br />
0, 0, 0, 1);<br />
orient(rot);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
*: types of billboards<br />
*:: screen-aligned - useful for annotation text, lens flares<br />
*::: normal is opposite to camera heading<br />
*::: up is camera->up<br />
<syntaxhighlight lang="cpp"><br />
case SCREEN:<br />
h = cameraHeading; // fixed<br />
u = cameraUp; // up is fixed <br />
r = cross(u, h);<br />
break;<br />
</syntaxhighlight><br />
*:: axial - useful for cylindrical symmetry - trees (textured object does not face straight on)<br />
*::: up is fixed<br />
*::: normal faces the viewer as much as possible<br />
<syntaxhighlight lang="cpp"><br />
case AXIAL:<br />
h = ::normal(position() - cameraPosition); // heading is open to change<br />
u = Vector(0, 1, 0); // up axis is fixed<br />
r = cross(u, h);<br />
h = cross(u, r);<br />
break;<br />
</syntaxhighlight><br />
*:: view_plane - no distortion - useful for<br />
*::: normal is fixed (opposite to camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEW_PLANE:<br />
h = cameraHeading; // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*:: viewpoint - simulates distortion due to perspective projection - useful for clouds<br />
*::: normal is fixed (difference between viewpoint position and camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEWPOINT:<br />
h = ::normal(position() - cameraPosition); // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*: Object.h and Object.cpp code<br />
* Texture Filtering<br />
*: mip maps<br />
*:: multum in parvo<br />
*:: texture creation<br />
*:: APITexture::SetSamplerState()<br />
<syntaxhighlight lang="cpp"><br />
// mipmap filtering<br />
if (flags & TEX_MIPMAP)<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);<br />
else<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_NONE);<br />
</syntaxhighlight><br />
* DirectX Errors<br />
*: DirectX Utilities - Lookup Tool<br />
*: APIDisplay::restore() example<br />
<syntaxhighlight lang="cpp"><br />
bool APIDisplay::restore() {<br />
<br />
bool rc = false;<br />
<br />
if (d3dd) {<br />
HRESULT hr;<br />
hr = d3dd->TestCooperativeLevel();<br />
if (hr == D3DERR_DEVICENOTRESET)<br />
// reset the APIDisplay device<br />
rc = d3dd->Reset(&d3dpp) == D3D_OK;<br />
else if (hr == S_OK)<br />
rc = true;<br />
}<br />
if (rc) {<br />
// reacquire sprite manager references to video memory<br />
if (manager)<br />
manager->OnResetDevice();<br />
}<br />
<br />
// complete the restoration<br />
if (rc) {<br />
setupLighting();<br />
setupBlending();<br />
}<br />
<br />
return rc;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* meshes sample<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 Rob Whitaker on Skyboxes]<br />
* [http://web.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/suman_wk8_IBR.pdf Image Based Rendering - Suman Nadella on Billboarding and Imposters]<br />
* [http://www.digitalrune.com/Products/GameEngine/Particles.aspx DigitalRune]<br />
* [http://en.wikipedia.org/wiki/Mipmap Wikipedia on Texture Filtering]<br />
* [http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx D3D 9 tutorial on modeling with an Index list]<br />
<br />
== Week 5 - Feb 6 ==<br />
=== This Week ===<br />
* Vertex Declarations<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172559%28v=vs.85%29.aspx FVF Codes]<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex><br />
class APIVertexDeclaration {<br />
<br />
static D3DVERTEXELEMENT9 fmt[MAXD3DDECLLENGTH + 1];<br />
static unsigned vertexSize;<br />
<br />
public:<br />
static D3DVERTEXELEMENT9* format() { return fmt; }<br />
static unsigned size() { return vertexSize; }<br />
};<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<Vertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_NORMAL, 0},<br />
{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_TEXCOORD, 0}, <br />
D3DDECL_END()};<br />
<br />
template<><br />
unsigned APIVertexDeclaration<Vertex>::vertexSize = 32;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
<br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<LitVertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_COLOR, 0},<br />
D3DDECL_END()};<br />
<br />
template <><br />
unsigned APIVertexDeclaration<LitVertex>::vertexSize = 16;<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172630%28v=vs.85%29.aspx D3DVERTEXELEMENT9 struct]<br />
* The Pipeline<br />
*: [http://en.wikipedia.org/wiki/Instruction_pipeline What is a pipeline]<br />
*:<br />
* The GPU<br />
*: [http://en.wikipedia.org/wiki/Graphics_processing_unit What is a GPU]<br />
** nVidia<br />
**: [http://en.wikipedia.org/wiki/Geforce GeForce]<br />
**: [http://en.wikipedia.org/wiki/NVIDIA_Quadro Quadro]<br />
**: [http://en.wikipedia.org/wiki/Nvidia_Tesla Tesla]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units Comparison]<br />
** AMD (previously ATI)<br />
**: [http://en.wikipedia.org/wiki/Radeon_R520 Radeon 520]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_AMD_graphics_processing_units Comparison]<br />
* Shader Languages<br />
*: [http://en.wikipedia.org/wiki/Shader what is a shader]<br />
*: dedicated shaders<br />
*: [http://en.wikipedia.org/wiki/Unified_shader_model unified shaders]<br />
*: how does a shader work<br />
** Languages<br />
**: [http://en.wikipedia.org/wiki/HLSL HLSL - Microsoft]<br />
**: [http://en.wikipedia.org/wiki/Cg_%28programming_language%29 Cg - nVidia]<br />
**: [http://en.wikipedia.org/wiki/GLSL GLSL - OpenGL (Khronos)]<br />
* Vertex Shaders<br />
* Pixel Shaders<br />
* effect of skybox and point light on frame rate<br />
<br />
=== To Do ===<br />
<br />
== Week 6 - Feb 13 ==<br />
=== This Week ===<br />
==== Vertex Shader Programming ====<br />
* Host<br />
: APIPlatformSettings.h - Vertex Shader Identification - select between fixed function and programmable pipelines here<br />
<syntaxhighlight lang="cpp"><br />
// shader file data<br />
#define VERTEX_SHADER_FILE L"vertexShader.hlsl"<br />
#define VERTEX_SHADER_ENTRY_POINT "vertexShader"<br />
</syntaxhighlight><br />
: APIBase.h - pointers into the shader - APIBase is the base class for the graphics API classes<br />
<syntaxhighlight lang="cpp"><br />
static IDirect3DVertexShader9* vertexShader; // vertex shader<br />
static ID3DXConstantTable* uniformVS; // for vertex shader<br />
</syntaxhighlight><br />
: APIBase.cpp - initialize the shader pointers<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DVertexShader9* APIBase::vertexShader = nullptr; // vertex shader<br />
ID3DXConstantTable* APIBase::uniformVS = nullptr; // for vertex shader<br />
</syntaxhighlight><br />
: APIDisplay.h - keeps track of the current projection matrix<br />
<syntaxhighlight lang="cpp"><br />
Matrix projection; // projection transformation<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup() - checks the shader version<br />
<syntaxhighlight lang="cpp"><br />
// points to compiled shader code<br />
LPD3DXBUFFER compiledCodeVS = nullptr;<br />
<br />
// check for minimum vertex shader version required<br />
if (caps.VertexShaderVersion < D3DVS_VERSION(2,0))<br />
error(L"APIDisplay::09 Device does not support vertex shader 2_0");<br />
</syntaxhighlight><br />
compiles the shader hlsl code, retrieves address of constant memory and vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// compile the vertex shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(VERTEX_SHADER_FILE, NULL,<br />
NULL, VERTEX_SHADER_ENTRY_POINT, D3DXGetVertexShaderProfile(d3dd),<br />
D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION,<br />
&compiledCodeVS, NULL, &uniformVS))) {<br />
release();<br />
error(L"APIDisplay::13 Unable to compile vertex shader");<br />
}<br />
// create the vertex shader object<br />
else if (FAILED(d3dd->CreateVertexShader(<br />
(DWORD*)compiledCodeVS->GetBufferPointer(), &vertexShader))) {<br />
compiledCodeVS->Release();<br />
release();<br />
error(L"APIDisplay::14 Unable to create vertex shader object");<br />
}<br />
else {<br />
compiledCodeVS->Release();<br />
</syntaxhighlight><br />
sets the current vertex shader<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetVertexShader(vertexShader);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setProjection() - stores the projection matrix<br />
<syntaxhighlight lang="cpp"><br />
this->projection = *((Matrix*)projection);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginDrawFrame() - copies the view matrix and the camera heading to constant memory<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewProjection = v * projection;<br />
uniformVS->SetMatrix(d3dd, "viewProjection",<br />
(D3DXMATRIX*)&viewProjection);<br />
Vector heading(v.m13, v.m23, v.m33);<br />
// Required for specular lighting calculations<br />
uniformVS->SetFloatArray(d3dd, "heading", (FLOAT*)&heading, 3);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformVS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformVS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - set() - copies the lighting state to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setWorld() - copies the world matrix to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetMatrix(d3dd, "world", (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity() - copies the reflectivity to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformVS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release() - releases constant memory and the vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// release the shader COM objects<br />
if (uniformVS) {<br />
uniformVS->Release();<br />
uniformVS = nullptr;<br />
}<br />
if (vertexShader) {<br />
vertexShader->Release();<br />
vertexShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APILight.cpp - setup() - copies the light properties to constant memory<br />
<syntaxhighlight lang="cpp"><br />
// Populate the vertex shader constant table<br />
//<br />
// Light descriptors within the vertex shader<br />
char typ[] = "light[0].type";<br />
char amb[] = "light[0].ambient";<br />
char dif[] = "light[0].diffuse";<br />
char spe[] = "light[0].specular";<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
char spt[] = "light[0].spot";<br />
char att[] = "light[0].attenuation";<br />
char ran[] = "light[0].range";<br />
//<br />
// Reset index in light descriptor<br />
typ[6] = index + '0';<br />
amb[6] = index + '0';<br />
dif[6] = index + '0';<br />
spe[6] = index + '0';<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
spt[6] = index + '0';<br />
att[6] = index + '0';<br />
ran[6] = index + '0';<br />
// Populate the vertex shader constant table<br />
Vector attenuation(attenuation0, attenuation1, attenuation2);<br />
Vector spot(cosf(phi/2), cosf(theta/2), falloff);<br />
Vector zero;<br />
uniformVS->SetInt(d3dd, typ, type);<br />
uniformVS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformVS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformVS->SetFloat(d3dd, ran, range);<br />
rc = true;<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn() - repositions the light and turns it on<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update() - repositions the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff() - turns off the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
uniformVS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APIGraphic.h - class APIXMesh - processes an X file mesh<br />
<syntaxhighlight lang="cpp"><br />
D3DXCOLOR* ambient;<br />
D3DXCOLOR* diffuse;<br />
D3DXCOLOR* specular;<br />
FLOAT* power;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - copy constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - operator=() = assignment operator<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
ambient = new D3DXCOLOR[src.nSubsets];<br />
diffuse = new D3DXCOLOR[src.nSubsets];<br />
specular = new D3DXCOLOR[src.nSubsets];<br />
power = new FLOAT[src.nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
ambient[i] = src.ambient[i];<br />
diffuse[i] = src.diffuse[i];<br />
specular[i] = src.specular[i];<br />
power[i] = src.power[i];<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - setup() -<br />
<syntaxhighlight lang="cpp"><br />
ambient = new D3DXCOLOR[nSubsets];<br />
diffuse = new D3DXCOLOR[nSubsets];<br />
specular = new D3DXCOLOR[nSubsets];<br />
power = new FLOAT[nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
ambient[i].r = matl[i].MatD3D.Diffuse.r * 0.7f;<br />
ambient[i].g = matl[i].MatD3D.Diffuse.g * 0.7f;<br />
ambient[i].b = matl[i].MatD3D.Diffuse.b * 0.7f;<br />
ambient[i].a = matl[i].MatD3D.Diffuse.a;<br />
diffuse[i] = matl[i].MatD3D.Diffuse; // reflected from lights<br />
specular[i] = matl[i].MatD3D.Specular; // shine from lights<br />
power[i] = matl[i].MatD3D.Power; // 0 if it shouldn't be shiny<br />
</syntaxhighlight><br />
: APIGraphic.cpp - draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformVS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawVertex holds the untransformed data for a single vertex<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for a single vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float4 colour : COLOR; // colour of the lit vertex<br />
float2 texCoord0 : TEXCOORD0; // texture coordinates - stage 0<br />
float2 texCoord1 : TEXCOORD1; // texture coordinates - stage 1<br />
};<br />
<br />
// Uniform Data (constant for a stream of vertices)<br />
//<br />
// Lighting<br />
float4 ambient; // global ambient light - always on<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // switches for static lights<br />
Material material; // material reflectivity<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw vertex and returns the transformed vertex<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed;<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
<br />
// not working<br />
if (litVertex) {<br />
transformed.colour.r = raw.normal.r;<br />
transformed.colour.g = raw.normal.g;<br />
transformed.colour.b = raw.normal.b;<br />
transformed.colour.a = 1.0f;<br />
}<br />
else {<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
<br />
// Determine the colour of the vertex from each light in turn<br />
//<br />
// Use the cosine of the angle between the worldNormal and the direction<br />
// of the light to determine the amount of reflected light. The cosine<br />
// is given by the dot product, if both vectors have been normalized. If<br />
// the cosine is less than 0, the angle is greater than 90 degrees and<br />
// no light is reflected. Use saturate() to implement this condition.<br />
//<br />
// A more efficient algorithm would supply the light direction already<br />
// converted to the local space of the vertex (by using the inverse of<br />
// the world transformation).<br />
//<br />
<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
float3 lightDirection, camera = normalize(heading);<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
<br />
for (int i = 0; i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
lightDirection = - normalize((light[i].type == POINT_LIGHT)?<br />
float3(worldPosition.x, worldPosition.y, worldPosition.z) -<br />
light[i].position : light[i].direction);<br />
diffuseFactor = saturate(dot(worldNormal, lightDirection));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
worldNormal - lightDirection), camera));<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length((float3)worldPosition - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(worldPosition.x, worldPosition.y,<br />
worldPosition.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(<br />
abs((rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit vertex<br />
//<br />
transformed.colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
<br />
// pass the diffuse alpha along as the alpha component<br />
//<br />
transformed.colour.w = material.diffuse.w;<br />
}<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord0 = raw.texCoord;<br />
transformed.texCoord1 = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
<br />
==== Fragment Shader ====<br />
* Host<br />
: APIPlatformSettings.h<br />
<syntaxhighlight lang="cpp"><br />
#define FRAGMENT_SHADER_FILE L"fragmentShader.hlsl"<br />
#define FRAGMENT_SHADER_ENTRY_POINT "fragmentShader"<br />
</syntaxhighlight><br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
// Fragment Shader Support<br />
static IDirect3DPixelShader9* fragmentShader; // fragment shader<br />
static ID3DXConstantTable* uniformFS; // for fragment shader<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DPixelShader9* APIBase::fragmentShader = nullptr; // fragment shader<br />
ID3DXConstantTable* APIBase::uniformFS = nullptr; // for fragment shader<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER compiledCodeFS = nullptr;<br />
<br />
// checks for minimum pixel shader version required<br />
else if (caps.PixelShaderVersion < D3DPS_VERSION(3,0))<br />
error(L"Display::10 Device does not support pixel shader 3_0");<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// compile the fragment shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(FRAGMENT_SHADER_FILE, NULL,<br />
NULL, FRAGMENT_SHADER_ENTRY_POINT, D3DXGetPixelShaderProfile(d3dd), 0,<br />
&compiledCodeFS, NULL, &uniformFS))) {<br />
release();<br />
error(L"APIDisplay::15 Unable to compile the fragment shader code");<br />
}<br />
// create the pixel shader object<br />
else if (FAILED(d3dd->CreatePixelShader(<br />
(DWORD*)compiledCodeFS->GetBufferPointer(), &fragmentShader))) {<br />
compiledCodeFS->Release();<br />
release();<br />
error(L"APIDisplay::16 Unable to create fragment shader object");<br />
}<br />
else {<br />
compiledCodeFS->Release();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172732%28v=vs.85%29.aspx D3DXCompileShaderFromFile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172870%28v=vs.85%29.aspx D3DXGetPixelShaderProfile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::CreatePixelShader()]<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetPixelShader(fragmentShader);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::SetPixelShader()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformFS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformFS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205775%28v=vs.85%29.aspx ID3DXConstantTable::SetFloatArray()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205776%28v=vs.85%29.aspx ID3DXConstantTable::SetInt()]<br />
: APIDisplay.cpp - set()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205771%28v=vs.85%29.aspx ID3DXConstantTable::SetBool()]<br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformFS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
}<br />
if (uniformFS) {<br />
uniformFS->Release();<br />
uniformFS = nullptr;<br />
}<br />
if (fragmentShader) {<br />
fragmentShader->Release();<br />
fragmentShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh::draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformFS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205774%28v=vs.85%29.aspx ID3DXConstantTable::SetFloat()]<br />
: APILight.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetInt(d3dd, typ, type);<br />
uniformFS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformFS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformFS->SetFloat(d3dd, ran, range);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APITexture.cpp - attach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, true);<br />
</syntaxhighlight><br />
: APITexture.cpp - detach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, false);<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 viewPoint; // camera viewpoint for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define MTEXTURES 2<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of active lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
bool lighting; // lighting calculations on?<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - fragmentShader()<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
}<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
* reorganize framework code so that vertex shader receives product of world, view, and projection matrices<br />
** store viewProjection matrix as an instance variable in APIDisplay<br />
** pre-multiply viewProjection by world to obtain composite matrix to pass to vertex shader<br />
** add composite matrix to the constant table in the vertex shader<br />
* reorganize framework code to minimize duplication of heading normalization<br />
** perform normalization of heading in APIDisplay::beginDrawFrame()<br />
<br />
=== Resources ===<br />
<br />
== Week 7 - Feb 20 ==<br />
=== This Week ===<br />
* Effects Framework<br />
** techniques<br />
*: passes<br />
* Source Code<br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
static ID3DXEffect* effect; // points to effects framework<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
ID3DXEffect* APIBase::effect = nullptr; // effects framework<br />
</syntaxhighlight><br />
: APIDisplay.h<br />
<syntaxhighlight lang="cpp"><br />
// Effects Framework handles<br />
D3DXHANDLE viewProjection; // view * projection<br />
D3DXHANDLE viewPoint; // camera viewpoint<br />
D3DXHANDLE ambient; // global ambient color<br />
D3DXHANDLE ambientHandle; // current ambient reflectivity<br />
D3DXHANDLE diffuseHandle; // current diffuse reflectivity<br />
D3DXHANDLE specularHandle; // current specular reflectivity<br />
D3DXHANDLE powerHandle; // current shininess coefficient<br />
D3DXHANDLE worldHandle; // current world transformation<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
void beginEffect(const char*, unsigned&);<br />
void beginPass(unsigned);<br />
void endPass();<br />
void endEffect();<br />
</syntaxhighlight><br />
: APIDisplay.cpp - APIDisplay()<br />
<syntaxhighlight lang="cpp"><br />
viewProjection = nullptr;<br />
viewPoint = nullptr;<br />
ambient = nullptr;<br />
ambientHandle = nullptr;<br />
diffuseHandle = nullptr;<br />
specularHandle = nullptr;<br />
powerHandle = nullptr;<br />
worldHandle = nullptr;<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER errorBuffer = NULL;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// create the effects framework<br />
else if (FAILED(D3DXCreateEffectFromFile(d3dd, EFFECT_FILE, 0,<br />
0, D3DXSHADER_DEBUG, 0, &effect, &errorBuffer))) {<br />
release();<br />
error(L"APIDisplay::17 Unable to create the effects framework");<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172768%28v=vs.85%29.aspx D3DXCreateEffectFromFile()]<br />
<syntaxhighlight lang="cpp"><br />
if (errorBuffer) errorBuffer->Release();<br />
viewProjection = effect->GetParameterByName(0, "viewProjection");<br />
viewPoint = effect->GetParameterByName(0, "viewPoint");<br />
ambient = effect->GetParameterByName(0, "ambient");<br />
worldHandle = effect->GetParameterByName(0, "world");<br />
ambientHandle = effect->GetParameterByName(0, "material.ambient");<br />
diffuseHandle = effect->GetParameterByName(0, "material.diffuse");<br />
specularHandle = effect->GetParameterByName(0, "material.specular");<br />
powerHandle = effect->GetParameterByName(0, "material.power");<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205696%28v=vs.85%29.aspx GetParameterByName()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewprojection = v * projection;<br />
Vector heading(v.m13, v.m23, v.m33);<br />
effect->SetMatrix(viewProjection, (D3DXMATRIX*)&viewprojection);<br />
effect->SetVector(viewPoint, (D3DXVECTOR4*)&heading);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205720%28v=vs.85%29.aspx SetMatrix()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205729%28v=vs.85%29.aspx SetVector()]<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
effect->SetVector(ambient, (D3DXVECTOR4*)&colour);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginEffect(const char* technique, unsigned& nPasses) {<br />
<br />
D3DXHANDLE techniqueHandle = effect->GetTechniqueByName(technique);<br />
effect->SetTechnique(techniqueHandle);<br />
effect->Begin(&nPasses, 0);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205706%28v=vs.85%29.aspx GetTechniqueByName()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205834%28v=vs.85%29.aspx SetTechnique()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205815%28v=vs.85%29.aspx Begin()]<br />
: APIDisplay.cpp - beginPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginPass(unsigned i) {<br />
<br />
effect->BeginPass(i);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205817%28v=vs.85%29.aspx BeginPass()]<br />
: APIDisplay.cpp - endPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endPass() {<br />
<br />
effect->EndPass();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205823%28v=vs.85%29.aspx EndPass()]<br />
: APIDisplay.cpp - endEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endEffect() {<br />
<br />
effect->End();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205821%28v=vs.85%29.aspx End()]<br />
: APIDisplay.cpp - setWorld()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetMatrix(worldHandle, (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetVector(ambientHandle, (D3DXVECTOR4*)&r.ambient);<br />
effect->SetVector(diffuseHandle, (D3DXVECTOR4*)&r.diffuse);<br />
effect->SetVector(specularHandle, (D3DXVECTOR4*)&r.specular);<br />
effect->SetFloat(powerHandle, r.power);<br />
effect->CommitChanges();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205819%28v=vs.85%29.aspx CommitChanges()]<br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
if (effect) {<br />
effect->Release();<br />
effect = NULL;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float3 ambient; <br />
float3 diffuse;<br />
float3 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of static lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float4 viewPoint; // camera viewpoint for specular calcs<br />
// Geometry<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: effects.fx - VertexShader<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - FragmentShader<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - technique opaque<br />
<syntaxhighlight lang="cpp"><br />
technique opaque {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - technique translucent<br />
<syntaxhighlight lang="cpp"><br />
technique translucent {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
</syntaxhighlight><br />
=== To Do ===<br />
=== Resources ===<br />
<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* Frank Luna's notes for DirectX10 (page 306)<br />
:[http://books.google.ca/books?id=AyACb-t8E-MC&pg=PA306&lpg=PA306#v=onepage&q&f=false Environment Maps](Google books)<br />
:[http://libcat.senecac.on.ca/vwebv/holdingsInfo?searchId=19588&recCount=50&recPointer=2&bibId=261220 Environment Maps](Seneca ELibraray) <br />
* Design.cpp<br />
: Design::initialize() - create the skybox object<br />
<syntaxhighlight lang="cpp"><br />
// initialize initializes the general display design coordinator, creates the<br />
// primitive sets, textures, objects, lights, sounds, cameras, and text items<br />
//<br />
void Design::initialize() {<br />
<br />
// ...<br />
<br />
// create textures<br />
iTexture* sunset = CreateCubeTexture(L"Islands.dds");<br />
<br />
// ...<br />
<br />
iObject* skybox = CreateSkybox();<br />
skybox->rotatex(-1.5708f);<br />
skybox->attach(sunset);<br />
setSkybox(skybox);<br />
<br />
// ...<br />
}<br />
</syntaxhighlight><br />
* Coordinator.cpp<br />
: Coordinator::render() - using different techniques for different objects<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render() {<br />
<br />
// adjust framecount and fps<br />
if (now - lastReset <= unitsPerSec)<br />
framecount++;<br />
else {<br />
// recalculate the frame rate<br />
fps = framecount * unitsPerSec / (now - lastReset);<br />
framecount = 0;<br />
lastReset = now;<br />
if (timerText) {<br />
wchar_t str[MAX_DESC + 1];<br />
sprintf(str, fps, L" fps");<br />
timerText->set(str);<br />
}<br />
}<br />
// update the user input devices<br />
userInput->update();<br />
Coordinator::update();<br />
// update the model<br />
update();<br />
// update the audio<br />
audio->setVolume(volume);<br />
audio->setFrequencyRatio(frequency);<br />
audio->update(Camera::getView());<br />
<br />
// start rendering<br />
display->beginDrawFrame(Camera::getView());<br />
display->setAmbientLight(ambient.r, ambient.g, ambient.b);<br />
unsigned nPasses;<br />
// render all of the opaque unlit objects<br />
display->beginEffect("opaque", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(OPAQUE_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the translucent unlit objects<br />
display->beginEffect("translucent", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(TRANSLUCENT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the lit objects<br />
display->beginEffect("litObjects", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(LIT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render the skybox<br />
display->beginEffect("skybox", nPasses);<br />
if (background && !skybox) {<br />
Rectf fullScreen(0, 0, 1, 1);<br />
display->beginDrawHUD(0);<br />
background->render(fullScreen, true);<br />
display->endDrawHUD();<br />
}<br />
else if (skybox) {<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(SKYBOX);<br />
display->endPass();<br />
}<br />
}<br />
display->endEffect();<br />
display->set(ALPHA_BLEND, false);<br />
display->beginDrawHUD(HUD_ALPHA);<br />
render(ALL_HUDS);<br />
display->endDrawHUD();<br />
display->endDrawFrame();<br />
render(ALL_SOUNDS);<br />
}<br />
</syntaxhighlight><br />
: Coordinator::render(iObject*) - render a single object one subset at a time<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render(iObject* object) {<br />
<br />
display->setWorld(&object->world());<br />
unsigned nSubsets = object->noSubsets();<br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
iTexture* texture = object->getTexture(i);<br />
if (texture) texture->attach();<br />
display->setReflectivity(object->getReflectivity(i));<br />
object->render(i);<br />
if (texture) texture->detach();<br />
}<br />
}<br />
</syntaxhighlight><br />
* Skybox class<br />
: iObject interface - CreateSkybox declaration<br />
<syntaxhighlight lang="cpp"><br />
class iObject : public Shape, public Base {<br />
public:<br />
// initialization<br />
virtual void attach(iTexture* t) = 0;<br />
virtual void attach(iTexture** t) = 0;<br />
// execution<br />
virtual unsigned noSubsets() const = 0;<br />
virtual void render(unsigned) = 0;<br />
virtual void setTextureFilter(unsigned) = 0;<br />
virtual iTexture* getTexture(unsigned) const = 0;<br />
virtual const void* getReflectivity(unsigned) const = 0;<br />
virtual bool belongsTo(Category category) const = 0;<br />
};<br />
<br />
iObject* CreateObject(iGraphic*, const Reflectivity* = nullptr, unsigned = 1u);<br />
iObject* CreateBillboard(BillboardType, iGraphic*,<br />
const Reflectivity* = nullptr);<br />
iObject* CreateSkybox();<br />
<br />
iObject* Clone(const iObject*);<br />
</syntaxhighlight><br />
: Skybox class - derived from Object<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
// A Skybox is an inverted Object that translates with the viewpoint<br />
//<br />
class Skybox : public Object {<br />
<br />
public:<br />
Skybox();<br />
void render(unsigned);<br />
};<br />
</syntaxhighlight><br />
: CreateSkybox<br />
<syntaxhighlight lang="cpp"><br />
iObject* CreateSkybox() {<br />
<br />
return new Skybox();<br />
}<br />
</syntaxhighlight><br />
: Skybox::Skybox - SKYBOX category, 2 x 2 x 2 cube<br />
<syntaxhighlight lang="cpp"><br />
Skybox::Skybox() : Object(SKYBOX, CreateIBox(-1, -1, -1 * MODEL_Z_AXIS, 1, 1,<br />
1 * MODEL_Z_AXIS)) {<br />
}<br />
</syntaxhighlight><br />
: Skybox::render(unsigned) - move skybox centroid to current camera position<br />
<syntaxhighlight lang="cpp"><br />
void Skybox::render(unsigned) {<br />
<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector disp = camera->position() - position();<br />
translate(disp.x, disp.y, disp.z);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
* Texture class<br />
: iTexture interface - CreateCubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iTexture : public Base {<br />
public:<br />
virtual void attach() const = 0;<br />
virtual void setFilter(unsigned) const = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, bool = false) = 0;<br />
};<br />
<br />
iTexture* CreateTexture(const wchar_t* file, unsigned filter = 0);<br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter = 0);<br />
<br />
iTexture* Clone(const iTexture*);<br />
</syntaxhighlight><br />
: Texture class - add the cube parameter to constructor<br />
<syntaxhighlight lang="cpp"><br />
class Texture : public iTexture {<br />
<br />
iAPITexture* apiTexture; // points to the api texture<br />
<br />
Texture(const Texture&);<br />
virtual ~Texture();<br />
<br />
public:<br />
Texture(const wchar_t* file, unsigned filter = 0, bool cube = false);<br />
Texture& operator=(const Texture&);<br />
void* clone() const { return new Texture(*this); }<br />
// execution<br />
void attach() const;<br />
void setFilter(unsigned) const;<br />
void detach();<br />
void render(const Rectf&, bool);<br />
// termination<br />
void suspend();<br />
void release();<br />
};</syntaxhighlight><br />
: CreateCubeTexture - call constructor with true flag for cube<br />
<syntaxhighlight lang="cpp"><br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter) {<br />
<br />
return new Texture(file, filter, true);<br />
}<br />
</syntaxhighlight><br />
: Texture::Texture() - create APICubeTexture()<br />
<syntaxhighlight lang="cpp"><br />
Texture::Texture(const wchar_t* file, unsigned filter, bool cube) {<br />
<br />
coordinator->add(this);<br />
<br />
wchar_t* fileWithPath = nullptr;<br />
if (file) {<br />
// add the directory to create the relative filename<br />
int len = strlen(file) + strlen(TEXTURE_DIRECTORY) + 1;<br />
fileWithPath = new wchar_t[len + 1];<br />
::nameWithDir(fileWithPath, TEXTURE_DIRECTORY, file, len);<br />
}<br />
<br />
// apiTexture on the graphics device<br />
if (cube)<br />
apiTexture = CreateAPICubeTexture(fileWithPath);<br />
else<br />
apiTexture = CreateAPITexture(fileWithPath, filter);<br />
<br />
if (fileWithPath) delete [] fileWithPath;<br />
}<br />
</syntaxhighlight><br />
: iAPITexture interface - add CreateAPICubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iAPITexture {<br />
public:<br />
virtual iAPITexture* clone() const = 0;<br />
// execution<br />
virtual void attach() = 0;<br />
virtual void setFilter(unsigned flags) = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, unsigned char, bool = false) = 0;<br />
// termination<br />
virtual void suspend() = 0;<br />
virtual void release() = 0;<br />
virtual void Delete() const = 0;<br />
};<br />
<br />
iAPITexture* CreateAPITexture(const wchar_t* file, unsigned filter);<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file);<br />
</syntaxhighlight><br />
* APITexture.h<br />
: APICubeTexture class definition<br />
<syntaxhighlight lang="cpp"><br />
class APICubeTexture : public iAPITexture, public APIBase {<br />
<br />
wchar_t* file; // points to file with texture image<br />
unsigned filter; // default texture filtering flags<br />
<br />
IDirect3DCubeTexture9* tex; // interface to texture COM object<br />
<br />
virtual ~APICubeTexture();<br />
<br />
void setup();<br />
<br />
public:<br />
APICubeTexture(const wchar_t* file);<br />
APICubeTexture(const APICubeTexture&);<br />
iAPITexture& operator=(const APICubeTexture&);<br />
iAPITexture* clone() const { return new APICubeTexture(*this); }<br />
// execution<br />
void attach();<br />
void setFilter(unsigned filter) {}<br />
void detach();<br />
void render(const Rectf&, unsigned char, bool) {}<br />
// suspension<br />
void suspend();<br />
// termination<br />
void release();<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174329%28v=vs.85%29.aspx IDirect3DCubeTexture9 interface]<br />
: APICubeTexture class implementation<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- APICubeTexture -----------------------------<br />
//<br />
// The APICubeTexture class implements a texture at the API level<br />
//<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file) {<br />
<br />
return new APICubeTexture(file);<br />
}<br />
<br />
// constructor initializes the texture identifier<br />
//<br />
APICubeTexture::APICubeTexture(const wchar_t* file) {<br />
<br />
if (file) {<br />
int len = strlen(file);<br />
this->file = new wchar_t[len + 1];<br />
strcpy(this->file, file, len);<br />
}<br />
else<br />
this->file = nullptr;<br />
<br />
tex = nullptr;<br />
}<br />
<br />
APICubeTexture::APICubeTexture(const APICubeTexture& src) {<br />
<br />
file = nullptr;<br />
tex = nullptr;<br />
*this = src; <br />
}<br />
<br />
iAPITexture& APICubeTexture::operator=(const APICubeTexture& src) {<br />
<br />
if (this != &src) {<br />
if (file)<br />
delete [] file;<br />
if (src.file) {<br />
int len = strlen(src.file);<br />
file = new wchar_t[len + 1];<br />
strcpy(file, src.file, len);<br />
}<br />
else<br />
file = nullptr;<br />
suspend();<br />
tex = nullptr;<br />
}<br />
<br />
return *this;<br />
}<br />
<br />
// setup creates the api texture from the texture file<br />
//<br />
void APICubeTexture::setup() {<br />
<br />
// create a texture COM object from the texture file<br />
//<br />
HRESULT hr;<br />
if (file && FAILED(hr = D3DXCreateCubeTextureFromFileEx(d3dd, file,<br />
0, D3DX_DEFAULT, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT,<br />
D3DX_DEFAULT, 0, nullptr, nullptr, &tex))) {<br />
error(L"APICubeTexture::11 Failed to create texture COM object from file");<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// attach attaches the api texture to sampling stage i<br />
//<br />
void APICubeTexture::attach() {<br />
<br />
if (!tex) setup();<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, tex);<br />
}<br />
<br />
// detach detaches the api texture from sampling stage 0<br />
//<br />
void APICubeTexture::detach() {<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, nullptr);<br />
}<br />
<br />
// suspend releases the api texture<br />
//<br />
void APICubeTexture::suspend() {<br />
<br />
// release the Interface to the texture COM object<br />
if (tex) {<br />
tex->Release();<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// releases suspends the api texture<br />
//<br />
void APICubeTexture::release() {<br />
<br />
suspend();<br />
}<br />
<br />
// destructor releases the api texture<br />
//<br />
APICubeTexture::~APICubeTexture() {<br />
<br />
release();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172757%28v=vs.85%29.aspx D3DXCreateCubeTextureFromFileEx]<br />
* effects.fx<br />
: vertex shader outpu structure<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
struct FS_Skybox {<br />
float4 pos : POSITION;<br />
float3 tex : TEXCOORD0;<br />
};<br />
</syntaxhighlight><br />
: vertex shader<br />
<syntaxhighlight lang="cpp"><br />
FS_Skybox skyboxVertexShader(float3 pos : POSITION) {<br />
FS_Skybox output = (FS_Skybox) 0;<br />
output.pos = mul(float4(pos, 0), world); // Note the 0, this so the skybox rotates, but without perspective<br />
output.pos = mul(output.pos, viewProjection).xyww; // The z coordinate is replaced by w, so that the point is projected onto the far clipping plane.<br />
output.tex = pos.xzy;<br />
return output;<br />
}<br />
</syntaxhighlight><br />
: skybox sampler state<br />
<syntaxhighlight lang="cpp"><br />
texture skyBox;<br />
samplerCUBE skySampler = sampler_state {<br />
texture = <skyBox>;<br />
MagFilter = LINEAR;<br />
Minfilter = LINEAR;<br />
Mipfilter = LINEAR;<br />
AddressU = MIRROR;<br />
AddressV = MIRROR;<br />
AddressW = MIRROR;<br />
};<br />
</syntaxhighlight><br />
: fragment shader<br />
<syntaxhighlight lang="cpp"><br />
float4 skyboxFragmentShader(FS_Skybox input) : COLOR0 {<br />
return texCUBE(skySampler, input.tex);<br />
}<br />
</syntaxhighlight><br />
: skybox technique<br />
<syntaxhighlight lang="cpp"><br />
technique skybox {<br />
<br />
pass {<br />
AlphaBlendEnable = false;<br />
ZENABLE = true;<br />
ZWRITEENABLE = false; // By not storing the skybox's z-buffer value, it enables objects behind the skybox to be drawn, giving a realist look (e.g. a airplane in the distance)<br />
CullMode = None;<br />
VertexShader = compile vs_3_0 skyboxVertexShader();<br />
PixelShader = compile ps_3_0 skyboxFragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 RB Whitaker's notes on skyboxes]<br />
* [http://knol.google.com/k/3d-skybox# Koen Samyn's knol]<br />
* [http://www.gameengineer.net/samples-graphics.html Game Engineer's demo]<br />
* [http://www.planetside.co.uk/terragen Terragen Texture Tool]<br />
* DirectX Utility - DirectX Texture Tool<br />
<br />
<!--<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* [http://msdn.microsoft.com/en-us/library/bb147178%28v=VS.85%29.aspx Mathematics of Lighting]<br />
* Lighting in Vertex Shaders<br />
** Notation<br />
**: G<sub>a</sub> - global ambient color<br />
**: C<sub>a</sub> - material ambient color<br />
**: C<sub>d</sub> - material diffuse color<br />
**: C<sub>s</sub> - material specular color<br />
**: L<sub>a<sub>i</sub></sub> - ambient color of light i<br />
**: L<sub>d<sub>i</sub></sub> - diffuse color of light i<br />
**: L<sub>s<sub>i</sub></sub> - specular color of light i<br />
**: L<sub>dir<sub>i</sub></sub> - direction vector of light i<br />
**: N - normal to the surface at the vertex<br />
*** [http://msdn.microsoft.com/en-us/library/bb172279%28v=VS.85%29.aspx Attenuation and Spotlight Factors]<br />
**** Atten<sub>i</sub> - attenuation of light i<br />
***: d<sub>i</sub> - distance from light i<br />
***:: d<sub>i</sub> = |L<sub>dir<sub>i</sub></sub>|<br />
***: a<sub>0</sub> - constant attenuation factor<br />
***: a<sub>1</sub> - linear attenuation factor<br />
***: a<sub>2</sub> - quadratic attenuation factor<br />
***: Atten<sub>i</sub> = 1/(a<sub>0</sub> + a<sub>1</sub> d<sub>i</sub> + a<sub>2</sub> d<sub>i</sub><sup>2</sup>)<br />
***: Atten<sub>i</sub> = [0, 1]<br />
**** Spot<sub>i</sub> - spot factor of light i<br />
***: Spot<sub>i</sub> = {[r<sub>i</sub> - cos(phi<sub>i</sub>/2)]/[cos(theta<sub>i</sub>/2) - cos(phi<sub>i</sub>/2)]}<sup>f<sub>i</sub></sup><br />
***: r<sub>i</sub> - cosine of angle from axis of spotlight<sub>i</sub><br />
***:: r<sub>i</sub> = norm(- light direction in camera space) . norm(L<sub>dir<sub>i</sub></sub>)<br />
***: phi<sub>i</sub> - penumbra (exterior cone) angle of spotlight<sub>i</sub><br />
***: theta<sub>i</sub> - umbra (interior cone) angle of spotlight<sub>i</sub><br />
***: f<sub>i</sub> - falloff factor of spotlight<sub>i</sub><br />
** [http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model Blinn-Phong and Phong]<br />
**: V - viewpoint vector<br />
**:: V = norm(Camera<sub>position</sub> - Vertex<sub>position</sub>)<br />
** Phong - account accurately for position of viewer<br />
**: Specular reflectance = (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup><br />
**: R<sub>i</sub> - reflection vector<br />
**:: R<sub>i</sub> = 2 * (N . L<sub>dir<sub>i</sub></sub>) N - L<sub>dir<sub>i</sub></sub><br />
**: p<sub>i</sub> - true specular power of light i<br />
**:<br />
** Blinn-Phong - use halfway vector instead of reflection vector - adjust power to compensate<br />
**: Specular reflectance = (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup><br />
**: H<sub>i</sub> - halfway vector<br />
**:: H<sub>i</sub> = norm(V + L<sub>dir<sub>i</sub></sub>)<br />
**:: H<sub>i</sub> = norm([0,0,1] + L<sub>dir<sub>i</sub></sub>) - less computationally intensive - assumes that camera is at infinity along z axis<br />
**: p'<sub>i</sub> - adjusted specular power of light i<br />
**:<br />
** [http://msdn.microsoft.com/en-us/library/bb172256%28v=VS.85%29.aspx Ambient]<br />
**: C<sub>a</sub> * ( G<sub>a</sub> + sum [L<sub>a<sub>i</sub></sub> * Atten<sub>i</sub> * Spot<sub>i</sub>] )<br />
** [http://msdn.microsoft.com/en-us/library/bb219656%28v=VS.85%29.aspx Diffuse]<br />
**: C<sub>d</sub> * sum [ L<sub>d<sub>i</sub></sub> * (N . L<sub>dir<sub>i</sub></sub>) * Atten<sub>i</sub> * Spot<sub>i</sub> ]<br />
** [http://msdn.microsoft.com/en-us/library/bb147399%28VS.85%29.aspx Specular]<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Blinn-Phong<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Phong<br />
** [http://msdn.microsoft.com/en-us/library/ff471376%28v=vs.85%29.aspx HLSL Intrinsic Functions]<br />
*** [http://msdn.microsoft.com/en-us/library/bb509630%28v=vs.85%29.aspx normalize()] - normalize a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509594%28v=vs.85%29.aspx dot(,)] - dot product of two vectors of any size<br />
*** [http://msdn.microsoft.com/en-us/library/bb509617%28v=vs.85%29.aspx length()] - length of a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509645%28v=vs.85%29.aspx saturate()] - clamp scalar, vector, or matrix to [0, 1]<br />
=== To Do ===<br />
=== Resources ===<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=GAM670/DPS905_Weekly_Schedule_20121&diff=82686GAM670/DPS905 Weekly Schedule 201212012-03-09T14:21:04Z<p>Gbatumbya: /* This Week */</p>
<hr />
<div>{{GAM670/DPS905 Index | 20121}}<br />
= GAM670/DPS905 -- Weekly Schedule 20121=<br />
<br />
== Week 1 - Jan 8 ==<br />
<br />
=== This Week ===<br />
* Assignment Discussion<br />
* Suggested Enhancements<br />
* Review of the Base Code<br />
** Definition of a Framework<br />
*** Modularity through stable interfaces<br />
*** Re-usability through generic components<br />
*** Extensibility through hook methods<br />
*** Inversion of control - determines which application methods to invoke in response to external events<br />
** Framework Architecture<br />
*** Modelling Layer<br />
*** API Translation Layer<br />
** Notable Features of the Base Code<br />
** camera, sound, and light are also derived from the Frame class<br />
** textures attach at the object level<br />
** texture connection is uncoupled from drawing of the graphics primitives<br />
** reference frames are relative<br />
** very simple collision detection<br />
<br />
=== To Do ===<br />
<br />
# add your name to the student list<br />
# create a team page that includes the semester number 20121<br />
#* describe the game that you intend to develop<br />
#* list the topics of interest to your team in developing its game<br />
#* list the other topics of interest<br />
<!--<br />
# Port Game Design over to Update Base Code--><br />
<br />
=== Resources ===<br />
<br />
<br />
== Week 2 - Jan 16 ==<br />
<br />
=== This Week ===<br />
<br />
* Relative Reference Frames<br />
** Recursive calls<br />
**: Vector Frame::position()<br />
**: Matrix Frame::rotation()<br />
**: Matrix Frame::world()<br />
** Detaching from and attaching to a parent frame<br />
**: Frame::attachTo()<br />
* Geometry<br />
** Plane<br />
**: normal + constant - examples<br />
**: equation of a plane: dot(n, x) + D = 0<br />
**: positive side of a plane dot(n, x) + D > 0<br />
* Collision Detection<br />
*: types of colliders<br />
*:: spheres<br />
*:: planes<br />
*:: axis-aligned bounding boxes<br />
*:: oriented bounding boxes<br />
<br />
=== To Do ===<br />
* Research the feature that you are going to add and prepare a plan of action<br />
* Prepare a team page for your team so that repos can be ordered<br />
* Add a section to your team page to track your project and solicit commentary<br />
<br />
=== Resources ===<br />
<br />
== Week 3 - Jan 23 ==<br />
=== This Week ===<br />
* Collision Detection (cont'd)<br />
*: Shape<br />
*:: Shape : Frame<br />
*:: Shape::setRadius()<br />
*:: Shape::getRadius()<br />
*:: Shape::setRadius(float r);<br />
*:: Shape::setRadius(float x, float y, float z);<br />
*:: Shape::getRadius() const { return radius; }<br />
*:: Shape::setPlane(Vector n, float d);<br />
*:: Shape::setAxisAligned(Vector min, Vector max);<br />
* Comprehensive Camerawork<br />
*: rotation about an axis<br />
*: order of rotation matters<br />
*: Euler angles<br />
*:: [http://www.youtube.com/watch?v=UpSMNYTVqQI&feature=related 3-2-1 angles]<br />
*: gimbal lock<br />
*:: [http://www.youtube.com/watch?v=rrUCBOlJdt4&feature=related StephenSeefeld.net]<br />
*: complex numbers<br />
*:: solution of cubic equations 16th century<br />
*:: two-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers matrix representation]<br />
*: quaternions<br />
*:: extension of complex numbers<br />
*:: four-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Quaternion#Matrix_representations matrix representation]<br />
*: geometric algebra (more abstract)<br />
*:: [http://staff.science.uva.nl/~leo/cinderella/line1.html Dorst's site]<br />
*:: [http://sinai.apphy.u-fukui.ac.jp/gcj/software/GAcindy-1.4/GAcindy.htm Hitzer's site]<br />
* Visibility Determination<br />
**: test a point for presence within a set of planes<br />
**: normal calculations - general rotation matrix - vector and angle<br />
** ViewFrustum<br />
**: parameter - view * projection<br />
**: 6 planes<br />
**:: near and far planes<br />
**:: left and right planes<br />
**:: top and bottom planes<br />
**: coding<br />
**:: constructor<br />
**:: ViewFrustum::contains()<br />
** Finite Size of Objects<br />
**: Expansion of the View Frustum<br />
* Index Buffers<br />
*: amount of storage needed for vertex data<br />
*: duplication of vertex data<br />
*: indexing<br />
*: indexed primitives<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://en.wikipedia.org/wiki/Complex_number Wikipedia on Complex Numbers]<br />
* [http://en.wikipedia.org/wiki/Quaternion Wikipedia on Quaternions]<br />
* [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Wikipedia on quaternions and Spatial Rotations]<br />
* [http://mathworld.wolfram.com/Quaternion.html Wolfram on Quaternions]<br />
* [http://www.cprogramming.com/tutorial/3d/quaternions.html CProgramming.com on Quaternions]<br />
* [http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer Ogre intro on Quaternions]<br />
* collision sample<br />
* indexBuffering sample<br />
<br />
<br />
== Week 4 - Jan 30 ==<br />
=== This Week ===<br />
* Meshes<br />
*: What is a mesh?<br />
*:: vertex list -> vertex buffer<br />
*:: index list -> index buffer<br />
*:: attribute list -> subset to which primitives belong<br />
*:: pyramid sample<br />
*: Stock Objects<br />
*:: Sphere<br />
*::: slices and partitions<br />
*:: Cylinder<br />
*:: Torus<br />
*:: Utah Teapot<br />
*:: APIGraphic.h and .cpp code<br />
*: Custom Mesh<br />
*:: Create a Mesh<br />
*:: APIGraphic.h code<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex, class I = Index><br />
class APICustomMesh : public iAPIGraphic, public APIBase {<br />
<br />
unsigned nSubsets; // number of subsets<br />
unsigned nPrimitives; // number of primitives<br />
unsigned* attribute; // points to mesh's attribute list<br />
I* index; // points to mesh's array of indices<br />
unsigned iIndex; // number of indices currently saved<br />
unsigned nIndices; // number of indices in the mesh<br />
T* vertex; // points to mesh's array of vertices<br />
unsigned iVertex; // number of vertices currently saved<br />
unsigned nVertices; // number of vertices in the mesh<br />
LPD3DXMESH apiMesh; // set of vertices, indices<br />
<br />
protected:<br />
virtual ~APICustomMesh();<br />
void setup();<br />
<br />
public:<br />
APICustomMesh(unsigned*, int, int, int, int);<br />
APICustomMesh(const APICustomMesh& v); <br />
APICustomMesh& operator=(const APICustomMesh& v);<br />
APICustomMesh* clone() const { return new APICustomMesh(*this); }<br />
unsigned add(const T& v);<br />
void add(unsigned);<br />
void draw(unsigned);<br />
void suspend();<br />
void release() { suspend(); }<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::APICustomMesh(unsigned* a, int np, int ni, int nv, int ns)<br />
: nSubsets(ns), nPrimitives(np), nIndices(ni), nVertices(nv), iIndex(0),<br />
iVertex(0) {<br />
<br />
attribute = new unsigned[nPrimitives];<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
attribute[i] = a[i];<br />
<br />
index = new I[nIndices];<br />
vertex = new T[nVertices];<br />
<br />
apiMesh = nullptr;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - add()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
unsigned APICustomMesh<T, I>::add(const T& v) {<br />
<br />
unsigned i = iVertex;<br />
<br />
if (vertex && iVertex < nVertices)<br />
vertex[iVertex++] = v;<br />
<br />
return i;<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::add(unsigned v) {<br />
<br />
if (index && iIndex < nIndices)<br />
index[iIndex++] = v;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::setup() {<br />
<br />
T *pv;<br />
I *pi;<br />
DWORD *pa;<br />
nIndices = iIndex;<br />
nVertices = iVertex;<br />
<br />
// create an empty mesh and lock its buffers<br />
if (FAILED(D3DXCreateMesh(nPrimitives, nVertices, 0,<br />
APIVertexDeclaration<T>::format(), d3dd, &apiMesh))) {<br />
error(L"APIMesh::14 Couldn\'t create the empty mesh");<br />
apiMesh = nullptr;<br />
}<br />
else if (FAILED(apiMesh->LockVertexBuffer(0, (void**)&pv))) {<br />
error(L"APIMesh::15 Couldn\'t lock vertex buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockIndexBuffer(0, (void**)&pi))) {<br />
error(L"APIMesh::16 Couldn\'t lock index buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockAttributeBuffer(0, &pa))) {<br />
error(L"APIMesh::17 Couldn\'t lock attribute buffer");<br />
release();<br />
}<br />
else {<br />
// populate the newly created Vertex Buffer<br />
for (unsigned i = 0; i < nVertices; i++)<br />
vertex[i].populate((void**)&pv);<br />
apiMesh->UnlockVertexBuffer();<br />
// populate the newly created Index Buffer<br />
for (unsigned i = 0; i < nIndices; i++)<br />
pi[i] = index[i];<br />
apiMesh->UnlockIndexBuffer();<br />
// Populate the newly created Attribute Buffer<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
pa[i] = attribute[i];<br />
apiMesh->UnlockAttributeBuffer();<br />
}<br />
}</syntaxhighlight><br />
*:: APIGraphic.cpp - DrawSubset()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::draw(unsigned iSubset) {<br />
<br />
// if mesh doesn't exist, set it up first<br />
if (!apiMesh) setup();<br />
<br />
if (apiMesh)<br />
apiMesh->DrawSubset(iSubset);<br />
}<br />
</syntaxhighlight><br />
*::: DrawIndexedPrimitive parameters<br />
*:: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::suspend() {<br />
<br />
// release the interface to the mesh<br />
if (apiMesh) {<br />
apiMesh->Release();<br />
apiMesh = nullptr;<br />
}<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - ~APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::~APICustomMesh() {<br />
<br />
release();<br />
if (attribute)<br />
delete [] attribute;<br />
if (index)<br />
delete [] index;<br />
if (vertex)<br />
delete [] vertex;<br />
}<br />
</syntaxhighlight><br />
*: X File<br />
*:: Create Mesh from File<br />
* SkyBox<br />
*: definition of a skybox<br />
*:: attachment to camera<br />
*:: inverted coordinates<br />
*: skybox textures<br />
*: Graphic.cpp code<br />
*: more complicated forms - skydome<br />
* Billboards<br />
*: definition, purpose of a billboard<br />
<syntaxhighlight lang="cpp"><br />
void Billboard::render(unsigned) {<br />
<br />
Vector h, u, r, p = position();<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector cameraPosition = camera->position();<br />
Vector cameraHeading = ::normal(camera->orientation('z'));<br />
Vector cameraUp = ::normal(camera->orientation('y'));<br />
switch (type) {<br />
// ... see below<br />
}<br />
Matrix rot(r.x, r.y, r.z, 0,<br />
u.x, u.y, u.z, 0,<br />
h.x, h.y, h.z, 0,<br />
0, 0, 0, 1);<br />
orient(rot);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
*: types of billboards<br />
*:: screen-aligned - useful for annotation text, lens flares<br />
*::: normal is opposite to camera heading<br />
*::: up is camera->up<br />
<syntaxhighlight lang="cpp"><br />
case SCREEN:<br />
h = cameraHeading; // fixed<br />
u = cameraUp; // up is fixed <br />
r = cross(u, h);<br />
break;<br />
</syntaxhighlight><br />
*:: axial - useful for cylindrical symmetry - trees (textured object does not face straight on)<br />
*::: up is fixed<br />
*::: normal faces the viewer as much as possible<br />
<syntaxhighlight lang="cpp"><br />
case AXIAL:<br />
h = ::normal(position() - cameraPosition); // heading is open to change<br />
u = Vector(0, 1, 0); // up axis is fixed<br />
r = cross(u, h);<br />
h = cross(u, r);<br />
break;<br />
</syntaxhighlight><br />
*:: view_plane - no distortion - useful for<br />
*::: normal is fixed (opposite to camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEW_PLANE:<br />
h = cameraHeading; // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*:: viewpoint - simulates distortion due to perspective projection - useful for clouds<br />
*::: normal is fixed (difference between viewpoint position and camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEWPOINT:<br />
h = ::normal(position() - cameraPosition); // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*: Object.h and Object.cpp code<br />
* Texture Filtering<br />
*: mip maps<br />
*:: multum in parvo<br />
*:: texture creation<br />
*:: APITexture::SetSamplerState()<br />
<syntaxhighlight lang="cpp"><br />
// mipmap filtering<br />
if (flags & TEX_MIPMAP)<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);<br />
else<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_NONE);<br />
</syntaxhighlight><br />
* DirectX Errors<br />
*: DirectX Utilities - Lookup Tool<br />
*: APIDisplay::restore() example<br />
<syntaxhighlight lang="cpp"><br />
bool APIDisplay::restore() {<br />
<br />
bool rc = false;<br />
<br />
if (d3dd) {<br />
HRESULT hr;<br />
hr = d3dd->TestCooperativeLevel();<br />
if (hr == D3DERR_DEVICENOTRESET)<br />
// reset the APIDisplay device<br />
rc = d3dd->Reset(&d3dpp) == D3D_OK;<br />
else if (hr == S_OK)<br />
rc = true;<br />
}<br />
if (rc) {<br />
// reacquire sprite manager references to video memory<br />
if (manager)<br />
manager->OnResetDevice();<br />
}<br />
<br />
// complete the restoration<br />
if (rc) {<br />
setupLighting();<br />
setupBlending();<br />
}<br />
<br />
return rc;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* meshes sample<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 Rob Whitaker on Skyboxes]<br />
* [http://web.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/suman_wk8_IBR.pdf Image Based Rendering - Suman Nadella on Billboarding and Imposters]<br />
* [http://www.digitalrune.com/Products/GameEngine/Particles.aspx DigitalRune]<br />
* [http://en.wikipedia.org/wiki/Mipmap Wikipedia on Texture Filtering]<br />
* [http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx D3D 9 tutorial on modeling with an Index list]<br />
<br />
== Week 5 - Feb 6 ==<br />
=== This Week ===<br />
* Vertex Declarations<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172559%28v=vs.85%29.aspx FVF Codes]<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex><br />
class APIVertexDeclaration {<br />
<br />
static D3DVERTEXELEMENT9 fmt[MAXD3DDECLLENGTH + 1];<br />
static unsigned vertexSize;<br />
<br />
public:<br />
static D3DVERTEXELEMENT9* format() { return fmt; }<br />
static unsigned size() { return vertexSize; }<br />
};<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<Vertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_NORMAL, 0},<br />
{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_TEXCOORD, 0}, <br />
D3DDECL_END()};<br />
<br />
template<><br />
unsigned APIVertexDeclaration<Vertex>::vertexSize = 32;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
<br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<LitVertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_COLOR, 0},<br />
D3DDECL_END()};<br />
<br />
template <><br />
unsigned APIVertexDeclaration<LitVertex>::vertexSize = 16;<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172630%28v=vs.85%29.aspx D3DVERTEXELEMENT9 struct]<br />
* The Pipeline<br />
*: [http://en.wikipedia.org/wiki/Instruction_pipeline What is a pipeline]<br />
*:<br />
* The GPU<br />
*: [http://en.wikipedia.org/wiki/Graphics_processing_unit What is a GPU]<br />
** nVidia<br />
**: [http://en.wikipedia.org/wiki/Geforce GeForce]<br />
**: [http://en.wikipedia.org/wiki/NVIDIA_Quadro Quadro]<br />
**: [http://en.wikipedia.org/wiki/Nvidia_Tesla Tesla]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units Comparison]<br />
** AMD (previously ATI)<br />
**: [http://en.wikipedia.org/wiki/Radeon_R520 Radeon 520]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_AMD_graphics_processing_units Comparison]<br />
* Shader Languages<br />
*: [http://en.wikipedia.org/wiki/Shader what is a shader]<br />
*: dedicated shaders<br />
*: [http://en.wikipedia.org/wiki/Unified_shader_model unified shaders]<br />
*: how does a shader work<br />
** Languages<br />
**: [http://en.wikipedia.org/wiki/HLSL HLSL - Microsoft]<br />
**: [http://en.wikipedia.org/wiki/Cg_%28programming_language%29 Cg - nVidia]<br />
**: [http://en.wikipedia.org/wiki/GLSL GLSL - OpenGL (Khronos)]<br />
* Vertex Shaders<br />
* Pixel Shaders<br />
* effect of skybox and point light on frame rate<br />
<br />
=== To Do ===<br />
<br />
== Week 6 - Feb 13 ==<br />
=== This Week ===<br />
==== Vertex Shader Programming ====<br />
* Host<br />
: APIPlatformSettings.h - Vertex Shader Identification - select between fixed function and programmable pipelines here<br />
<syntaxhighlight lang="cpp"><br />
// shader file data<br />
#define VERTEX_SHADER_FILE L"vertexShader.hlsl"<br />
#define VERTEX_SHADER_ENTRY_POINT "vertexShader"<br />
</syntaxhighlight><br />
: APIBase.h - pointers into the shader - APIBase is the base class for the graphics API classes<br />
<syntaxhighlight lang="cpp"><br />
static IDirect3DVertexShader9* vertexShader; // vertex shader<br />
static ID3DXConstantTable* uniformVS; // for vertex shader<br />
</syntaxhighlight><br />
: APIBase.cpp - initialize the shader pointers<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DVertexShader9* APIBase::vertexShader = nullptr; // vertex shader<br />
ID3DXConstantTable* APIBase::uniformVS = nullptr; // for vertex shader<br />
</syntaxhighlight><br />
: APIDisplay.h - keeps track of the current projection matrix<br />
<syntaxhighlight lang="cpp"><br />
Matrix projection; // projection transformation<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup() - checks the shader version<br />
<syntaxhighlight lang="cpp"><br />
// points to compiled shader code<br />
LPD3DXBUFFER compiledCodeVS = nullptr;<br />
<br />
// check for minimum vertex shader version required<br />
if (caps.VertexShaderVersion < D3DVS_VERSION(2,0))<br />
error(L"APIDisplay::09 Device does not support vertex shader 2_0");<br />
</syntaxhighlight><br />
compiles the shader hlsl code, retrieves address of constant memory and vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// compile the vertex shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(VERTEX_SHADER_FILE, NULL,<br />
NULL, VERTEX_SHADER_ENTRY_POINT, D3DXGetVertexShaderProfile(d3dd),<br />
D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION,<br />
&compiledCodeVS, NULL, &uniformVS))) {<br />
release();<br />
error(L"APIDisplay::13 Unable to compile vertex shader");<br />
}<br />
// create the vertex shader object<br />
else if (FAILED(d3dd->CreateVertexShader(<br />
(DWORD*)compiledCodeVS->GetBufferPointer(), &vertexShader))) {<br />
compiledCodeVS->Release();<br />
release();<br />
error(L"APIDisplay::14 Unable to create vertex shader object");<br />
}<br />
else {<br />
compiledCodeVS->Release();<br />
</syntaxhighlight><br />
sets the current vertex shader<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetVertexShader(vertexShader);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setProjection() - stores the projection matrix<br />
<syntaxhighlight lang="cpp"><br />
this->projection = *((Matrix*)projection);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginDrawFrame() - copies the view matrix and the camera heading to constant memory<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewProjection = v * projection;<br />
uniformVS->SetMatrix(d3dd, "viewProjection",<br />
(D3DXMATRIX*)&viewProjection);<br />
Vector heading(v.m13, v.m23, v.m33);<br />
// Required for specular lighting calculations<br />
uniformVS->SetFloatArray(d3dd, "heading", (FLOAT*)&heading, 3);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformVS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformVS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - set() - copies the lighting state to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setWorld() - copies the world matrix to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetMatrix(d3dd, "world", (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity() - copies the reflectivity to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformVS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release() - releases constant memory and the vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// release the shader COM objects<br />
if (uniformVS) {<br />
uniformVS->Release();<br />
uniformVS = nullptr;<br />
}<br />
if (vertexShader) {<br />
vertexShader->Release();<br />
vertexShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APILight.cpp - setup() - copies the light properties to constant memory<br />
<syntaxhighlight lang="cpp"><br />
// Populate the vertex shader constant table<br />
//<br />
// Light descriptors within the vertex shader<br />
char typ[] = "light[0].type";<br />
char amb[] = "light[0].ambient";<br />
char dif[] = "light[0].diffuse";<br />
char spe[] = "light[0].specular";<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
char spt[] = "light[0].spot";<br />
char att[] = "light[0].attenuation";<br />
char ran[] = "light[0].range";<br />
//<br />
// Reset index in light descriptor<br />
typ[6] = index + '0';<br />
amb[6] = index + '0';<br />
dif[6] = index + '0';<br />
spe[6] = index + '0';<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
spt[6] = index + '0';<br />
att[6] = index + '0';<br />
ran[6] = index + '0';<br />
// Populate the vertex shader constant table<br />
Vector attenuation(attenuation0, attenuation1, attenuation2);<br />
Vector spot(cosf(phi/2), cosf(theta/2), falloff);<br />
Vector zero;<br />
uniformVS->SetInt(d3dd, typ, type);<br />
uniformVS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformVS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformVS->SetFloat(d3dd, ran, range);<br />
rc = true;<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn() - repositions the light and turns it on<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update() - repositions the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff() - turns off the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
uniformVS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APIGraphic.h - class APIXMesh - processes an X file mesh<br />
<syntaxhighlight lang="cpp"><br />
D3DXCOLOR* ambient;<br />
D3DXCOLOR* diffuse;<br />
D3DXCOLOR* specular;<br />
FLOAT* power;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - copy constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - operator=() = assignment operator<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
ambient = new D3DXCOLOR[src.nSubsets];<br />
diffuse = new D3DXCOLOR[src.nSubsets];<br />
specular = new D3DXCOLOR[src.nSubsets];<br />
power = new FLOAT[src.nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
ambient[i] = src.ambient[i];<br />
diffuse[i] = src.diffuse[i];<br />
specular[i] = src.specular[i];<br />
power[i] = src.power[i];<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - setup() -<br />
<syntaxhighlight lang="cpp"><br />
ambient = new D3DXCOLOR[nSubsets];<br />
diffuse = new D3DXCOLOR[nSubsets];<br />
specular = new D3DXCOLOR[nSubsets];<br />
power = new FLOAT[nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
ambient[i].r = matl[i].MatD3D.Diffuse.r * 0.7f;<br />
ambient[i].g = matl[i].MatD3D.Diffuse.g * 0.7f;<br />
ambient[i].b = matl[i].MatD3D.Diffuse.b * 0.7f;<br />
ambient[i].a = matl[i].MatD3D.Diffuse.a;<br />
diffuse[i] = matl[i].MatD3D.Diffuse; // reflected from lights<br />
specular[i] = matl[i].MatD3D.Specular; // shine from lights<br />
power[i] = matl[i].MatD3D.Power; // 0 if it shouldn't be shiny<br />
</syntaxhighlight><br />
: APIGraphic.cpp - draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformVS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawVertex holds the untransformed data for a single vertex<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for a single vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float4 colour : COLOR; // colour of the lit vertex<br />
float2 texCoord0 : TEXCOORD0; // texture coordinates - stage 0<br />
float2 texCoord1 : TEXCOORD1; // texture coordinates - stage 1<br />
};<br />
<br />
// Uniform Data (constant for a stream of vertices)<br />
//<br />
// Lighting<br />
float4 ambient; // global ambient light - always on<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // switches for static lights<br />
Material material; // material reflectivity<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw vertex and returns the transformed vertex<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed;<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
<br />
// not working<br />
if (litVertex) {<br />
transformed.colour.r = raw.normal.r;<br />
transformed.colour.g = raw.normal.g;<br />
transformed.colour.b = raw.normal.b;<br />
transformed.colour.a = 1.0f;<br />
}<br />
else {<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
<br />
// Determine the colour of the vertex from each light in turn<br />
//<br />
// Use the cosine of the angle between the worldNormal and the direction<br />
// of the light to determine the amount of reflected light. The cosine<br />
// is given by the dot product, if both vectors have been normalized. If<br />
// the cosine is less than 0, the angle is greater than 90 degrees and<br />
// no light is reflected. Use saturate() to implement this condition.<br />
//<br />
// A more efficient algorithm would supply the light direction already<br />
// converted to the local space of the vertex (by using the inverse of<br />
// the world transformation).<br />
//<br />
<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
float3 lightDirection, camera = normalize(heading);<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
<br />
for (int i = 0; i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
lightDirection = - normalize((light[i].type == POINT_LIGHT)?<br />
float3(worldPosition.x, worldPosition.y, worldPosition.z) -<br />
light[i].position : light[i].direction);<br />
diffuseFactor = saturate(dot(worldNormal, lightDirection));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
worldNormal - lightDirection), camera));<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length((float3)worldPosition - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(worldPosition.x, worldPosition.y,<br />
worldPosition.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(<br />
abs((rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit vertex<br />
//<br />
transformed.colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
<br />
// pass the diffuse alpha along as the alpha component<br />
//<br />
transformed.colour.w = material.diffuse.w;<br />
}<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord0 = raw.texCoord;<br />
transformed.texCoord1 = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
<br />
==== Fragment Shader ====<br />
* Host<br />
: APIPlatformSettings.h<br />
<syntaxhighlight lang="cpp"><br />
#define FRAGMENT_SHADER_FILE L"fragmentShader.hlsl"<br />
#define FRAGMENT_SHADER_ENTRY_POINT "fragmentShader"<br />
</syntaxhighlight><br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
// Fragment Shader Support<br />
static IDirect3DPixelShader9* fragmentShader; // fragment shader<br />
static ID3DXConstantTable* uniformFS; // for fragment shader<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DPixelShader9* APIBase::fragmentShader = nullptr; // fragment shader<br />
ID3DXConstantTable* APIBase::uniformFS = nullptr; // for fragment shader<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER compiledCodeFS = nullptr;<br />
<br />
// checks for minimum pixel shader version required<br />
else if (caps.PixelShaderVersion < D3DPS_VERSION(3,0))<br />
error(L"Display::10 Device does not support pixel shader 3_0");<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// compile the fragment shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(FRAGMENT_SHADER_FILE, NULL,<br />
NULL, FRAGMENT_SHADER_ENTRY_POINT, D3DXGetPixelShaderProfile(d3dd), 0,<br />
&compiledCodeFS, NULL, &uniformFS))) {<br />
release();<br />
error(L"APIDisplay::15 Unable to compile the fragment shader code");<br />
}<br />
// create the pixel shader object<br />
else if (FAILED(d3dd->CreatePixelShader(<br />
(DWORD*)compiledCodeFS->GetBufferPointer(), &fragmentShader))) {<br />
compiledCodeFS->Release();<br />
release();<br />
error(L"APIDisplay::16 Unable to create fragment shader object");<br />
}<br />
else {<br />
compiledCodeFS->Release();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172732%28v=vs.85%29.aspx D3DXCompileShaderFromFile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172870%28v=vs.85%29.aspx D3DXGetPixelShaderProfile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::CreatePixelShader()]<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetPixelShader(fragmentShader);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::SetPixelShader()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformFS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformFS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205775%28v=vs.85%29.aspx ID3DXConstantTable::SetFloatArray()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205776%28v=vs.85%29.aspx ID3DXConstantTable::SetInt()]<br />
: APIDisplay.cpp - set()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205771%28v=vs.85%29.aspx ID3DXConstantTable::SetBool()]<br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformFS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
}<br />
if (uniformFS) {<br />
uniformFS->Release();<br />
uniformFS = nullptr;<br />
}<br />
if (fragmentShader) {<br />
fragmentShader->Release();<br />
fragmentShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh::draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformFS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205774%28v=vs.85%29.aspx ID3DXConstantTable::SetFloat()]<br />
: APILight.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetInt(d3dd, typ, type);<br />
uniformFS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformFS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformFS->SetFloat(d3dd, ran, range);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APITexture.cpp - attach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, true);<br />
</syntaxhighlight><br />
: APITexture.cpp - detach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, false);<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 viewPoint; // camera viewpoint for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define MTEXTURES 2<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of active lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
bool lighting; // lighting calculations on?<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - fragmentShader()<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
}<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
* reorganize framework code so that vertex shader receives product of world, view, and projection matrices<br />
** store viewProjection matrix as an instance variable in APIDisplay<br />
** pre-multiply viewProjection by world to obtain composite matrix to pass to vertex shader<br />
** add composite matrix to the constant table in the vertex shader<br />
* reorganize framework code to minimize duplication of heading normalization<br />
** perform normalization of heading in APIDisplay::beginDrawFrame()<br />
<br />
=== Resources ===<br />
<br />
== Week 7 - Feb 20 ==<br />
=== This Week ===<br />
* Effects Framework<br />
** techniques<br />
*: passes<br />
* Source Code<br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
static ID3DXEffect* effect; // points to effects framework<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
ID3DXEffect* APIBase::effect = nullptr; // effects framework<br />
</syntaxhighlight><br />
: APIDisplay.h<br />
<syntaxhighlight lang="cpp"><br />
// Effects Framework handles<br />
D3DXHANDLE viewProjection; // view * projection<br />
D3DXHANDLE viewPoint; // camera viewpoint<br />
D3DXHANDLE ambient; // global ambient color<br />
D3DXHANDLE ambientHandle; // current ambient reflectivity<br />
D3DXHANDLE diffuseHandle; // current diffuse reflectivity<br />
D3DXHANDLE specularHandle; // current specular reflectivity<br />
D3DXHANDLE powerHandle; // current shininess coefficient<br />
D3DXHANDLE worldHandle; // current world transformation<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
void beginEffect(const char*, unsigned&);<br />
void beginPass(unsigned);<br />
void endPass();<br />
void endEffect();<br />
</syntaxhighlight><br />
: APIDisplay.cpp - APIDisplay()<br />
<syntaxhighlight lang="cpp"><br />
viewProjection = nullptr;<br />
viewPoint = nullptr;<br />
ambient = nullptr;<br />
ambientHandle = nullptr;<br />
diffuseHandle = nullptr;<br />
specularHandle = nullptr;<br />
powerHandle = nullptr;<br />
worldHandle = nullptr;<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER errorBuffer = NULL;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// create the effects framework<br />
else if (FAILED(D3DXCreateEffectFromFile(d3dd, EFFECT_FILE, 0,<br />
0, D3DXSHADER_DEBUG, 0, &effect, &errorBuffer))) {<br />
release();<br />
error(L"APIDisplay::17 Unable to create the effects framework");<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172768%28v=vs.85%29.aspx D3DXCreateEffectFromFile()]<br />
<syntaxhighlight lang="cpp"><br />
if (errorBuffer) errorBuffer->Release();<br />
viewProjection = effect->GetParameterByName(0, "viewProjection");<br />
viewPoint = effect->GetParameterByName(0, "viewPoint");<br />
ambient = effect->GetParameterByName(0, "ambient");<br />
worldHandle = effect->GetParameterByName(0, "world");<br />
ambientHandle = effect->GetParameterByName(0, "material.ambient");<br />
diffuseHandle = effect->GetParameterByName(0, "material.diffuse");<br />
specularHandle = effect->GetParameterByName(0, "material.specular");<br />
powerHandle = effect->GetParameterByName(0, "material.power");<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205696%28v=vs.85%29.aspx GetParameterByName()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewprojection = v * projection;<br />
Vector heading(v.m13, v.m23, v.m33);<br />
effect->SetMatrix(viewProjection, (D3DXMATRIX*)&viewprojection);<br />
effect->SetVector(viewPoint, (D3DXVECTOR4*)&heading);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205720%28v=vs.85%29.aspx SetMatrix()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205729%28v=vs.85%29.aspx SetVector()]<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
effect->SetVector(ambient, (D3DXVECTOR4*)&colour);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginEffect(const char* technique, unsigned& nPasses) {<br />
<br />
D3DXHANDLE techniqueHandle = effect->GetTechniqueByName(technique);<br />
effect->SetTechnique(techniqueHandle);<br />
effect->Begin(&nPasses, 0);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205706%28v=vs.85%29.aspx GetTechniqueByName()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205834%28v=vs.85%29.aspx SetTechnique()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205815%28v=vs.85%29.aspx Begin()]<br />
: APIDisplay.cpp - beginPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginPass(unsigned i) {<br />
<br />
effect->BeginPass(i);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205817%28v=vs.85%29.aspx BeginPass()]<br />
: APIDisplay.cpp - endPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endPass() {<br />
<br />
effect->EndPass();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205823%28v=vs.85%29.aspx EndPass()]<br />
: APIDisplay.cpp - endEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endEffect() {<br />
<br />
effect->End();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205821%28v=vs.85%29.aspx End()]<br />
: APIDisplay.cpp - setWorld()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetMatrix(worldHandle, (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetVector(ambientHandle, (D3DXVECTOR4*)&r.ambient);<br />
effect->SetVector(diffuseHandle, (D3DXVECTOR4*)&r.diffuse);<br />
effect->SetVector(specularHandle, (D3DXVECTOR4*)&r.specular);<br />
effect->SetFloat(powerHandle, r.power);<br />
effect->CommitChanges();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205819%28v=vs.85%29.aspx CommitChanges()]<br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
if (effect) {<br />
effect->Release();<br />
effect = NULL;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float3 ambient; <br />
float3 diffuse;<br />
float3 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of static lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float4 viewPoint; // camera viewpoint for specular calcs<br />
// Geometry<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: effects.fx - VertexShader<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - FragmentShader<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - technique opaque<br />
<syntaxhighlight lang="cpp"><br />
technique opaque {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - technique translucent<br />
<syntaxhighlight lang="cpp"><br />
technique translucent {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
</syntaxhighlight><br />
=== To Do ===<br />
=== Resources ===<br />
<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* Frank Luna's notes for DirectX10 (page 306)<br />
:[http://books.google.ca/books?id=AyACb-t8E-MC&pg=PA306&lpg=PA306#v=onepage&q&f=false Environment Maps](Google books)<br />
:[http://libcat.senecac.on.ca/vwebv/holdingsInfo?searchId=19588&recCount=50&recPointer=2&bibId=261220 Environment Maps](Seneca ELibraray) <br />
* Design.cpp<br />
: Design::initialize() - create the skybox object<br />
<syntaxhighlight lang="cpp"><br />
// initialize initializes the general display design coordinator, creates the<br />
// primitive sets, textures, objects, lights, sounds, cameras, and text items<br />
//<br />
void Design::initialize() {<br />
<br />
// ...<br />
<br />
// create textures<br />
iTexture* sunset = CreateCubeTexture(L"Islands.dds");<br />
<br />
// ...<br />
<br />
iObject* skybox = CreateSkybox();<br />
skybox->rotatex(-1.5708f);<br />
skybox->attach(sunset);<br />
setSkybox(skybox);<br />
<br />
// ...<br />
}<br />
</syntaxhighlight><br />
* Coordinator.cpp<br />
: Coordinator::render() - using different techniques for different objects<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render() {<br />
<br />
// adjust framecount and fps<br />
if (now - lastReset <= unitsPerSec)<br />
framecount++;<br />
else {<br />
// recalculate the frame rate<br />
fps = framecount * unitsPerSec / (now - lastReset);<br />
framecount = 0;<br />
lastReset = now;<br />
if (timerText) {<br />
wchar_t str[MAX_DESC + 1];<br />
sprintf(str, fps, L" fps");<br />
timerText->set(str);<br />
}<br />
}<br />
// update the user input devices<br />
userInput->update();<br />
Coordinator::update();<br />
// update the model<br />
update();<br />
// update the audio<br />
audio->setVolume(volume);<br />
audio->setFrequencyRatio(frequency);<br />
audio->update(Camera::getView());<br />
<br />
// start rendering<br />
display->beginDrawFrame(Camera::getView());<br />
display->setAmbientLight(ambient.r, ambient.g, ambient.b);<br />
unsigned nPasses;<br />
// render all of the opaque unlit objects<br />
display->beginEffect("opaque", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(OPAQUE_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the translucent unlit objects<br />
display->beginEffect("translucent", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(TRANSLUCENT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the lit objects<br />
display->beginEffect("litObjects", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(LIT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render the skybox<br />
display->beginEffect("skybox", nPasses);<br />
if (background && !skybox) {<br />
Rectf fullScreen(0, 0, 1, 1);<br />
display->beginDrawHUD(0);<br />
background->render(fullScreen, true);<br />
display->endDrawHUD();<br />
}<br />
else if (skybox) {<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(SKYBOX);<br />
display->endPass();<br />
}<br />
}<br />
display->endEffect();<br />
display->set(ALPHA_BLEND, false);<br />
display->beginDrawHUD(HUD_ALPHA);<br />
render(ALL_HUDS);<br />
display->endDrawHUD();<br />
display->endDrawFrame();<br />
render(ALL_SOUNDS);<br />
}<br />
</syntaxhighlight><br />
: Coordinator::render(iObject*) - render a single object one subset at a time<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render(iObject* object) {<br />
<br />
display->setWorld(&object->world());<br />
unsigned nSubsets = object->noSubsets();<br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
iTexture* texture = object->getTexture(i);<br />
if (texture) texture->attach();<br />
display->setReflectivity(object->getReflectivity(i));<br />
object->render(i);<br />
if (texture) texture->detach();<br />
}<br />
}<br />
</syntaxhighlight><br />
* Skybox class<br />
: iObject interface - CreateSkybox declaration<br />
<syntaxhighlight lang="cpp"><br />
class iObject : public Shape, public Base {<br />
public:<br />
// initialization<br />
virtual void attach(iTexture* t) = 0;<br />
virtual void attach(iTexture** t) = 0;<br />
// execution<br />
virtual unsigned noSubsets() const = 0;<br />
virtual void render(unsigned) = 0;<br />
virtual void setTextureFilter(unsigned) = 0;<br />
virtual iTexture* getTexture(unsigned) const = 0;<br />
virtual const void* getReflectivity(unsigned) const = 0;<br />
virtual bool belongsTo(Category category) const = 0;<br />
};<br />
<br />
iObject* CreateObject(iGraphic*, const Reflectivity* = nullptr, unsigned = 1u);<br />
iObject* CreateBillboard(BillboardType, iGraphic*,<br />
const Reflectivity* = nullptr);<br />
iObject* CreateSkybox();<br />
<br />
iObject* Clone(const iObject*);<br />
</syntaxhighlight><br />
: Skybox class - derived from Object<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
// A Skybox is an inverted Object that translates with the viewpoint<br />
//<br />
class Skybox : public Object {<br />
<br />
public:<br />
Skybox();<br />
void render(unsigned);<br />
};<br />
</syntaxhighlight><br />
: CreateSkybox<br />
<syntaxhighlight lang="cpp"><br />
iObject* CreateSkybox() {<br />
<br />
return new Skybox();<br />
}<br />
</syntaxhighlight><br />
: Skybox::Skybox - SKYBOX category, 2 x 2 x 2 cube<br />
<syntaxhighlight lang="cpp"><br />
Skybox::Skybox() : Object(SKYBOX, CreateIBox(-1, -1, -1 * MODEL_Z_AXIS, 1, 1,<br />
1 * MODEL_Z_AXIS)) {<br />
}<br />
</syntaxhighlight><br />
: Skybox::render(unsigned) - move skybox centroid to current camera position<br />
<syntaxhighlight lang="cpp"><br />
void Skybox::render(unsigned) {<br />
<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector disp = camera->position() - position();<br />
translate(disp.x, disp.y, disp.z);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
* Texture class<br />
: iTexture interface - CreateCubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iTexture : public Base {<br />
public:<br />
virtual void attach() const = 0;<br />
virtual void setFilter(unsigned) const = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, bool = false) = 0;<br />
};<br />
<br />
iTexture* CreateTexture(const wchar_t* file, unsigned filter = 0);<br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter = 0);<br />
<br />
iTexture* Clone(const iTexture*);<br />
</syntaxhighlight><br />
: Texture class - add the cube parameter to constructor<br />
<syntaxhighlight lang="cpp"><br />
class Texture : public iTexture {<br />
<br />
iAPITexture* apiTexture; // points to the api texture<br />
<br />
Texture(const Texture&);<br />
virtual ~Texture();<br />
<br />
public:<br />
Texture(const wchar_t* file, unsigned filter = 0, bool cube = false);<br />
Texture& operator=(const Texture&);<br />
void* clone() const { return new Texture(*this); }<br />
// execution<br />
void attach() const;<br />
void setFilter(unsigned) const;<br />
void detach();<br />
void render(const Rectf&, bool);<br />
// termination<br />
void suspend();<br />
void release();<br />
};</syntaxhighlight><br />
: CreateCubeTexture - call constructor with true flag for cube<br />
<syntaxhighlight lang="cpp"><br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter) {<br />
<br />
return new Texture(file, filter, true);<br />
}<br />
</syntaxhighlight><br />
: Texture::Texture() - create APICubeTexture()<br />
<syntaxhighlight lang="cpp"><br />
Texture::Texture(const wchar_t* file, unsigned filter, bool cube) {<br />
<br />
coordinator->add(this);<br />
<br />
wchar_t* fileWithPath = nullptr;<br />
if (file) {<br />
// add the directory to create the relative filename<br />
int len = strlen(file) + strlen(TEXTURE_DIRECTORY) + 1;<br />
fileWithPath = new wchar_t[len + 1];<br />
::nameWithDir(fileWithPath, TEXTURE_DIRECTORY, file, len);<br />
}<br />
<br />
// apiTexture on the graphics device<br />
if (cube)<br />
apiTexture = CreateAPICubeTexture(fileWithPath);<br />
else<br />
apiTexture = CreateAPITexture(fileWithPath, filter);<br />
<br />
if (fileWithPath) delete [] fileWithPath;<br />
}<br />
</syntaxhighlight><br />
: iAPITexture interface - add CreateAPICubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iAPITexture {<br />
public:<br />
virtual iAPITexture* clone() const = 0;<br />
// execution<br />
virtual void attach() = 0;<br />
virtual void setFilter(unsigned flags) = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, unsigned char, bool = false) = 0;<br />
// termination<br />
virtual void suspend() = 0;<br />
virtual void release() = 0;<br />
virtual void Delete() const = 0;<br />
};<br />
<br />
iAPITexture* CreateAPITexture(const wchar_t* file, unsigned filter);<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file);<br />
</syntaxhighlight><br />
* APITexture.h<br />
: APICubeTexture class definition<br />
<syntaxhighlight lang="cpp"><br />
class APICubeTexture : public iAPITexture, public APIBase {<br />
<br />
wchar_t* file; // points to file with texture image<br />
unsigned filter; // default texture filtering flags<br />
<br />
IDirect3DCubeTexture9* tex; // interface to texture COM object<br />
<br />
virtual ~APICubeTexture();<br />
<br />
void setup();<br />
<br />
public:<br />
APICubeTexture(const wchar_t* file);<br />
APICubeTexture(const APICubeTexture&);<br />
iAPITexture& operator=(const APICubeTexture&);<br />
iAPITexture* clone() const { return new APICubeTexture(*this); }<br />
// execution<br />
void attach();<br />
void setFilter(unsigned filter) {}<br />
void detach();<br />
void render(const Rectf&, unsigned char, bool) {}<br />
// suspension<br />
void suspend();<br />
// termination<br />
void release();<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174329%28v=vs.85%29.aspx IDirect3DCubeTexture9 interface]<br />
: APICubeTexture class implementation<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- APICubeTexture -----------------------------<br />
//<br />
// The APICubeTexture class implements a texture at the API level<br />
//<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file) {<br />
<br />
return new APICubeTexture(file);<br />
}<br />
<br />
// constructor initializes the texture identifier<br />
//<br />
APICubeTexture::APICubeTexture(const wchar_t* file) {<br />
<br />
if (file) {<br />
int len = strlen(file);<br />
this->file = new wchar_t[len + 1];<br />
strcpy(this->file, file, len);<br />
}<br />
else<br />
this->file = nullptr;<br />
<br />
tex = nullptr;<br />
}<br />
<br />
APICubeTexture::APICubeTexture(const APICubeTexture& src) {<br />
<br />
file = nullptr;<br />
tex = nullptr;<br />
*this = src; <br />
}<br />
<br />
iAPITexture& APICubeTexture::operator=(const APICubeTexture& src) {<br />
<br />
if (this != &src) {<br />
if (file)<br />
delete [] file;<br />
if (src.file) {<br />
int len = strlen(src.file);<br />
file = new wchar_t[len + 1];<br />
strcpy(file, src.file, len);<br />
}<br />
else<br />
file = nullptr;<br />
suspend();<br />
tex = nullptr;<br />
}<br />
<br />
return *this;<br />
}<br />
<br />
// setup creates the api texture from the texture file<br />
//<br />
void APICubeTexture::setup() {<br />
<br />
// create a texture COM object from the texture file<br />
//<br />
HRESULT hr;<br />
if (file && FAILED(hr = D3DXCreateCubeTextureFromFileEx(d3dd, file,<br />
0, D3DX_DEFAULT, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT,<br />
D3DX_DEFAULT, 0, nullptr, nullptr, &tex))) {<br />
error(L"APICubeTexture::11 Failed to create texture COM object from file");<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// attach attaches the api texture to sampling stage i<br />
//<br />
void APICubeTexture::attach() {<br />
<br />
if (!tex) setup();<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, tex);<br />
}<br />
<br />
// detach detaches the api texture from sampling stage 0<br />
//<br />
void APICubeTexture::detach() {<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, nullptr);<br />
}<br />
<br />
// suspend releases the api texture<br />
//<br />
void APICubeTexture::suspend() {<br />
<br />
// release the Interface to the texture COM object<br />
if (tex) {<br />
tex->Release();<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// releases suspends the api texture<br />
//<br />
void APICubeTexture::release() {<br />
<br />
suspend();<br />
}<br />
<br />
// destructor releases the api texture<br />
//<br />
APICubeTexture::~APICubeTexture() {<br />
<br />
release();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172757%28v=vs.85%29.aspx D3DXCreateCubeTextureFromFileEx]<br />
* effects.fx<br />
: vertex shader outpu structure<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
struct FS_Skybox {<br />
float4 pos : POSITION;<br />
float3 tex : TEXCOORD0;<br />
};<br />
</syntaxhighlight><br />
: vertex shader<br />
<syntaxhighlight lang="cpp"><br />
FS_Skybox skyboxVertexShader(float3 pos : POSITION) {<br />
FS_Skybox output = (FS_Skybox) 0;<br />
output.pos = mul(float4(pos, 0), world); // Note the 0, this so the skybox rotates, but without perspective<br />
output.pos = mul(output.pos, viewProjection).xyww; // The z coordinate is replaced by w, so that the point is projected onto the far clipping plane.<br />
output.tex = pos.xzy;<br />
return output;<br />
}<br />
</syntaxhighlight><br />
: skybox sampler state<br />
<syntaxhighlight lang="cpp"><br />
texture skyBox;<br />
samplerCUBE skySampler = sampler_state {<br />
texture = <skyBox>;<br />
MagFilter = LINEAR;<br />
Minfilter = LINEAR;<br />
Mipfilter = LINEAR;<br />
AddressU = MIRROR;<br />
AddressV = MIRROR;<br />
AddressW = MIRROR;<br />
};<br />
</syntaxhighlight><br />
: fragment shader<br />
<syntaxhighlight lang="cpp"><br />
float4 skyboxFragmentShader(FS_Skybox input) : COLOR0 {<br />
return texCUBE(skySampler, input.tex);<br />
}<br />
</syntaxhighlight><br />
: skybox technique<br />
<syntaxhighlight lang="cpp"><br />
technique skybox {<br />
<br />
pass {<br />
AlphaBlendEnable = false;<br />
ZENABLE = true;<br />
ZWRITEENABLE = false;<br />
CullMode = None;<br />
VertexShader = compile vs_3_0 skyboxVertexShader();<br />
PixelShader = compile ps_3_0 skyboxFragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 RB Whitaker's notes on skyboxes]<br />
* [http://knol.google.com/k/3d-skybox# Koen Samyn's knol]<br />
* [http://www.gameengineer.net/samples-graphics.html Game Engineer's demo]<br />
* [http://www.planetside.co.uk/terragen Terragen Texture Tool]<br />
* DirectX Utility - DirectX Texture Tool<br />
<br />
<!--<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* [http://msdn.microsoft.com/en-us/library/bb147178%28v=VS.85%29.aspx Mathematics of Lighting]<br />
* Lighting in Vertex Shaders<br />
** Notation<br />
**: G<sub>a</sub> - global ambient color<br />
**: C<sub>a</sub> - material ambient color<br />
**: C<sub>d</sub> - material diffuse color<br />
**: C<sub>s</sub> - material specular color<br />
**: L<sub>a<sub>i</sub></sub> - ambient color of light i<br />
**: L<sub>d<sub>i</sub></sub> - diffuse color of light i<br />
**: L<sub>s<sub>i</sub></sub> - specular color of light i<br />
**: L<sub>dir<sub>i</sub></sub> - direction vector of light i<br />
**: N - normal to the surface at the vertex<br />
*** [http://msdn.microsoft.com/en-us/library/bb172279%28v=VS.85%29.aspx Attenuation and Spotlight Factors]<br />
**** Atten<sub>i</sub> - attenuation of light i<br />
***: d<sub>i</sub> - distance from light i<br />
***:: d<sub>i</sub> = |L<sub>dir<sub>i</sub></sub>|<br />
***: a<sub>0</sub> - constant attenuation factor<br />
***: a<sub>1</sub> - linear attenuation factor<br />
***: a<sub>2</sub> - quadratic attenuation factor<br />
***: Atten<sub>i</sub> = 1/(a<sub>0</sub> + a<sub>1</sub> d<sub>i</sub> + a<sub>2</sub> d<sub>i</sub><sup>2</sup>)<br />
***: Atten<sub>i</sub> = [0, 1]<br />
**** Spot<sub>i</sub> - spot factor of light i<br />
***: Spot<sub>i</sub> = {[r<sub>i</sub> - cos(phi<sub>i</sub>/2)]/[cos(theta<sub>i</sub>/2) - cos(phi<sub>i</sub>/2)]}<sup>f<sub>i</sub></sup><br />
***: r<sub>i</sub> - cosine of angle from axis of spotlight<sub>i</sub><br />
***:: r<sub>i</sub> = norm(- light direction in camera space) . norm(L<sub>dir<sub>i</sub></sub>)<br />
***: phi<sub>i</sub> - penumbra (exterior cone) angle of spotlight<sub>i</sub><br />
***: theta<sub>i</sub> - umbra (interior cone) angle of spotlight<sub>i</sub><br />
***: f<sub>i</sub> - falloff factor of spotlight<sub>i</sub><br />
** [http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model Blinn-Phong and Phong]<br />
**: V - viewpoint vector<br />
**:: V = norm(Camera<sub>position</sub> - Vertex<sub>position</sub>)<br />
** Phong - account accurately for position of viewer<br />
**: Specular reflectance = (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup><br />
**: R<sub>i</sub> - reflection vector<br />
**:: R<sub>i</sub> = 2 * (N . L<sub>dir<sub>i</sub></sub>) N - L<sub>dir<sub>i</sub></sub><br />
**: p<sub>i</sub> - true specular power of light i<br />
**:<br />
** Blinn-Phong - use halfway vector instead of reflection vector - adjust power to compensate<br />
**: Specular reflectance = (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup><br />
**: H<sub>i</sub> - halfway vector<br />
**:: H<sub>i</sub> = norm(V + L<sub>dir<sub>i</sub></sub>)<br />
**:: H<sub>i</sub> = norm([0,0,1] + L<sub>dir<sub>i</sub></sub>) - less computationally intensive - assumes that camera is at infinity along z axis<br />
**: p'<sub>i</sub> - adjusted specular power of light i<br />
**:<br />
** [http://msdn.microsoft.com/en-us/library/bb172256%28v=VS.85%29.aspx Ambient]<br />
**: C<sub>a</sub> * ( G<sub>a</sub> + sum [L<sub>a<sub>i</sub></sub> * Atten<sub>i</sub> * Spot<sub>i</sub>] )<br />
** [http://msdn.microsoft.com/en-us/library/bb219656%28v=VS.85%29.aspx Diffuse]<br />
**: C<sub>d</sub> * sum [ L<sub>d<sub>i</sub></sub> * (N . L<sub>dir<sub>i</sub></sub>) * Atten<sub>i</sub> * Spot<sub>i</sub> ]<br />
** [http://msdn.microsoft.com/en-us/library/bb147399%28VS.85%29.aspx Specular]<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Blinn-Phong<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Phong<br />
** [http://msdn.microsoft.com/en-us/library/ff471376%28v=vs.85%29.aspx HLSL Intrinsic Functions]<br />
*** [http://msdn.microsoft.com/en-us/library/bb509630%28v=vs.85%29.aspx normalize()] - normalize a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509594%28v=vs.85%29.aspx dot(,)] - dot product of two vectors of any size<br />
*** [http://msdn.microsoft.com/en-us/library/bb509617%28v=vs.85%29.aspx length()] - length of a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509645%28v=vs.85%29.aspx saturate()] - clamp scalar, vector, or matrix to [0, 1]<br />
=== To Do ===<br />
=== Resources ===<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=GAM670/DPS905_Weekly_Schedule_20121&diff=82684GAM670/DPS905 Weekly Schedule 201212012-03-09T13:59:14Z<p>Gbatumbya: /* This Week */</p>
<hr />
<div>{{GAM670/DPS905 Index | 20121}}<br />
= GAM670/DPS905 -- Weekly Schedule 20121=<br />
<br />
== Week 1 - Jan 8 ==<br />
<br />
=== This Week ===<br />
* Assignment Discussion<br />
* Suggested Enhancements<br />
* Review of the Base Code<br />
** Definition of a Framework<br />
*** Modularity through stable interfaces<br />
*** Re-usability through generic components<br />
*** Extensibility through hook methods<br />
*** Inversion of control - determines which application methods to invoke in response to external events<br />
** Framework Architecture<br />
*** Modelling Layer<br />
*** API Translation Layer<br />
** Notable Features of the Base Code<br />
** camera, sound, and light are also derived from the Frame class<br />
** textures attach at the object level<br />
** texture connection is uncoupled from drawing of the graphics primitives<br />
** reference frames are relative<br />
** very simple collision detection<br />
<br />
=== To Do ===<br />
<br />
# add your name to the student list<br />
# create a team page that includes the semester number 20121<br />
#* describe the game that you intend to develop<br />
#* list the topics of interest to your team in developing its game<br />
#* list the other topics of interest<br />
<!--<br />
# Port Game Design over to Update Base Code--><br />
<br />
=== Resources ===<br />
<br />
<br />
== Week 2 - Jan 16 ==<br />
<br />
=== This Week ===<br />
<br />
* Relative Reference Frames<br />
** Recursive calls<br />
**: Vector Frame::position()<br />
**: Matrix Frame::rotation()<br />
**: Matrix Frame::world()<br />
** Detaching from and attaching to a parent frame<br />
**: Frame::attachTo()<br />
* Geometry<br />
** Plane<br />
**: normal + constant - examples<br />
**: equation of a plane: dot(n, x) + D = 0<br />
**: positive side of a plane dot(n, x) + D > 0<br />
* Collision Detection<br />
*: types of colliders<br />
*:: spheres<br />
*:: planes<br />
*:: axis-aligned bounding boxes<br />
*:: oriented bounding boxes<br />
<br />
=== To Do ===<br />
* Research the feature that you are going to add and prepare a plan of action<br />
* Prepare a team page for your team so that repos can be ordered<br />
* Add a section to your team page to track your project and solicit commentary<br />
<br />
=== Resources ===<br />
<br />
== Week 3 - Jan 23 ==<br />
=== This Week ===<br />
* Collision Detection (cont'd)<br />
*: Shape<br />
*:: Shape : Frame<br />
*:: Shape::setRadius()<br />
*:: Shape::getRadius()<br />
*:: Shape::setRadius(float r);<br />
*:: Shape::setRadius(float x, float y, float z);<br />
*:: Shape::getRadius() const { return radius; }<br />
*:: Shape::setPlane(Vector n, float d);<br />
*:: Shape::setAxisAligned(Vector min, Vector max);<br />
* Comprehensive Camerawork<br />
*: rotation about an axis<br />
*: order of rotation matters<br />
*: Euler angles<br />
*:: [http://www.youtube.com/watch?v=UpSMNYTVqQI&feature=related 3-2-1 angles]<br />
*: gimbal lock<br />
*:: [http://www.youtube.com/watch?v=rrUCBOlJdt4&feature=related StephenSeefeld.net]<br />
*: complex numbers<br />
*:: solution of cubic equations 16th century<br />
*:: two-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers matrix representation]<br />
*: quaternions<br />
*:: extension of complex numbers<br />
*:: four-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Quaternion#Matrix_representations matrix representation]<br />
*: geometric algebra (more abstract)<br />
*:: [http://staff.science.uva.nl/~leo/cinderella/line1.html Dorst's site]<br />
*:: [http://sinai.apphy.u-fukui.ac.jp/gcj/software/GAcindy-1.4/GAcindy.htm Hitzer's site]<br />
* Visibility Determination<br />
**: test a point for presence within a set of planes<br />
**: normal calculations - general rotation matrix - vector and angle<br />
** ViewFrustum<br />
**: parameter - view * projection<br />
**: 6 planes<br />
**:: near and far planes<br />
**:: left and right planes<br />
**:: top and bottom planes<br />
**: coding<br />
**:: constructor<br />
**:: ViewFrustum::contains()<br />
** Finite Size of Objects<br />
**: Expansion of the View Frustum<br />
* Index Buffers<br />
*: amount of storage needed for vertex data<br />
*: duplication of vertex data<br />
*: indexing<br />
*: indexed primitives<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://en.wikipedia.org/wiki/Complex_number Wikipedia on Complex Numbers]<br />
* [http://en.wikipedia.org/wiki/Quaternion Wikipedia on Quaternions]<br />
* [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Wikipedia on quaternions and Spatial Rotations]<br />
* [http://mathworld.wolfram.com/Quaternion.html Wolfram on Quaternions]<br />
* [http://www.cprogramming.com/tutorial/3d/quaternions.html CProgramming.com on Quaternions]<br />
* [http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer Ogre intro on Quaternions]<br />
* collision sample<br />
* indexBuffering sample<br />
<br />
<br />
== Week 4 - Jan 30 ==<br />
=== This Week ===<br />
* Meshes<br />
*: What is a mesh?<br />
*:: vertex list -> vertex buffer<br />
*:: index list -> index buffer<br />
*:: attribute list -> subset to which primitives belong<br />
*:: pyramid sample<br />
*: Stock Objects<br />
*:: Sphere<br />
*::: slices and partitions<br />
*:: Cylinder<br />
*:: Torus<br />
*:: Utah Teapot<br />
*:: APIGraphic.h and .cpp code<br />
*: Custom Mesh<br />
*:: Create a Mesh<br />
*:: APIGraphic.h code<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex, class I = Index><br />
class APICustomMesh : public iAPIGraphic, public APIBase {<br />
<br />
unsigned nSubsets; // number of subsets<br />
unsigned nPrimitives; // number of primitives<br />
unsigned* attribute; // points to mesh's attribute list<br />
I* index; // points to mesh's array of indices<br />
unsigned iIndex; // number of indices currently saved<br />
unsigned nIndices; // number of indices in the mesh<br />
T* vertex; // points to mesh's array of vertices<br />
unsigned iVertex; // number of vertices currently saved<br />
unsigned nVertices; // number of vertices in the mesh<br />
LPD3DXMESH apiMesh; // set of vertices, indices<br />
<br />
protected:<br />
virtual ~APICustomMesh();<br />
void setup();<br />
<br />
public:<br />
APICustomMesh(unsigned*, int, int, int, int);<br />
APICustomMesh(const APICustomMesh& v); <br />
APICustomMesh& operator=(const APICustomMesh& v);<br />
APICustomMesh* clone() const { return new APICustomMesh(*this); }<br />
unsigned add(const T& v);<br />
void add(unsigned);<br />
void draw(unsigned);<br />
void suspend();<br />
void release() { suspend(); }<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::APICustomMesh(unsigned* a, int np, int ni, int nv, int ns)<br />
: nSubsets(ns), nPrimitives(np), nIndices(ni), nVertices(nv), iIndex(0),<br />
iVertex(0) {<br />
<br />
attribute = new unsigned[nPrimitives];<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
attribute[i] = a[i];<br />
<br />
index = new I[nIndices];<br />
vertex = new T[nVertices];<br />
<br />
apiMesh = nullptr;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - add()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
unsigned APICustomMesh<T, I>::add(const T& v) {<br />
<br />
unsigned i = iVertex;<br />
<br />
if (vertex && iVertex < nVertices)<br />
vertex[iVertex++] = v;<br />
<br />
return i;<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::add(unsigned v) {<br />
<br />
if (index && iIndex < nIndices)<br />
index[iIndex++] = v;<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::setup() {<br />
<br />
T *pv;<br />
I *pi;<br />
DWORD *pa;<br />
nIndices = iIndex;<br />
nVertices = iVertex;<br />
<br />
// create an empty mesh and lock its buffers<br />
if (FAILED(D3DXCreateMesh(nPrimitives, nVertices, 0,<br />
APIVertexDeclaration<T>::format(), d3dd, &apiMesh))) {<br />
error(L"APIMesh::14 Couldn\'t create the empty mesh");<br />
apiMesh = nullptr;<br />
}<br />
else if (FAILED(apiMesh->LockVertexBuffer(0, (void**)&pv))) {<br />
error(L"APIMesh::15 Couldn\'t lock vertex buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockIndexBuffer(0, (void**)&pi))) {<br />
error(L"APIMesh::16 Couldn\'t lock index buffer");<br />
release();<br />
}<br />
else if (FAILED(apiMesh->LockAttributeBuffer(0, &pa))) {<br />
error(L"APIMesh::17 Couldn\'t lock attribute buffer");<br />
release();<br />
}<br />
else {<br />
// populate the newly created Vertex Buffer<br />
for (unsigned i = 0; i < nVertices; i++)<br />
vertex[i].populate((void**)&pv);<br />
apiMesh->UnlockVertexBuffer();<br />
// populate the newly created Index Buffer<br />
for (unsigned i = 0; i < nIndices; i++)<br />
pi[i] = index[i];<br />
apiMesh->UnlockIndexBuffer();<br />
// Populate the newly created Attribute Buffer<br />
for (unsigned i = 0; i < nPrimitives; i++)<br />
pa[i] = attribute[i];<br />
apiMesh->UnlockAttributeBuffer();<br />
}<br />
}</syntaxhighlight><br />
*:: APIGraphic.cpp - DrawSubset()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::draw(unsigned iSubset) {<br />
<br />
// if mesh doesn't exist, set it up first<br />
if (!apiMesh) setup();<br />
<br />
if (apiMesh)<br />
apiMesh->DrawSubset(iSubset);<br />
}<br />
</syntaxhighlight><br />
*::: DrawIndexedPrimitive parameters<br />
*:: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
void APICustomMesh<T, I>::suspend() {<br />
<br />
// release the interface to the mesh<br />
if (apiMesh) {<br />
apiMesh->Release();<br />
apiMesh = nullptr;<br />
}<br />
}<br />
</syntaxhighlight><br />
*:: APIGraphic.cpp - ~APIGraphic<br />
<syntaxhighlight lang="cpp"><br />
template <class T, class I><br />
APICustomMesh<T, I>::~APICustomMesh() {<br />
<br />
release();<br />
if (attribute)<br />
delete [] attribute;<br />
if (index)<br />
delete [] index;<br />
if (vertex)<br />
delete [] vertex;<br />
}<br />
</syntaxhighlight><br />
*: X File<br />
*:: Create Mesh from File<br />
* SkyBox<br />
*: definition of a skybox<br />
*:: attachment to camera<br />
*:: inverted coordinates<br />
*: skybox textures<br />
*: Graphic.cpp code<br />
*: more complicated forms - skydome<br />
* Billboards<br />
*: definition, purpose of a billboard<br />
<syntaxhighlight lang="cpp"><br />
void Billboard::render(unsigned) {<br />
<br />
Vector h, u, r, p = position();<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector cameraPosition = camera->position();<br />
Vector cameraHeading = ::normal(camera->orientation('z'));<br />
Vector cameraUp = ::normal(camera->orientation('y'));<br />
switch (type) {<br />
// ... see below<br />
}<br />
Matrix rot(r.x, r.y, r.z, 0,<br />
u.x, u.y, u.z, 0,<br />
h.x, h.y, h.z, 0,<br />
0, 0, 0, 1);<br />
orient(rot);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
*: types of billboards<br />
*:: screen-aligned - useful for annotation text, lens flares<br />
*::: normal is opposite to camera heading<br />
*::: up is camera->up<br />
<syntaxhighlight lang="cpp"><br />
case SCREEN:<br />
h = cameraHeading; // fixed<br />
u = cameraUp; // up is fixed <br />
r = cross(u, h);<br />
break;<br />
</syntaxhighlight><br />
*:: axial - useful for cylindrical symmetry - trees (textured object does not face straight on)<br />
*::: up is fixed<br />
*::: normal faces the viewer as much as possible<br />
<syntaxhighlight lang="cpp"><br />
case AXIAL:<br />
h = ::normal(position() - cameraPosition); // heading is open to change<br />
u = Vector(0, 1, 0); // up axis is fixed<br />
r = cross(u, h);<br />
h = cross(u, r);<br />
break;<br />
</syntaxhighlight><br />
*:: view_plane - no distortion - useful for<br />
*::: normal is fixed (opposite to camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEW_PLANE:<br />
h = cameraHeading; // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*:: viewpoint - simulates distortion due to perspective projection - useful for clouds<br />
*::: normal is fixed (difference between viewpoint position and camera heading)<br />
*::: up is open to change<br />
<syntaxhighlight lang="cpp"><br />
case VIEWPOINT:<br />
h = ::normal(position() - cameraPosition); // heading is fixed<br />
u = Vector(0, 1, 0); // up is open to change<br />
r = cross(u, h);<br />
u = cross(h, r);<br />
break;<br />
</syntaxhighlight><br />
*: Object.h and Object.cpp code<br />
* Texture Filtering<br />
*: mip maps<br />
*:: multum in parvo<br />
*:: texture creation<br />
*:: APITexture::SetSamplerState()<br />
<syntaxhighlight lang="cpp"><br />
// mipmap filtering<br />
if (flags & TEX_MIPMAP)<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);<br />
else<br />
d3dd->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_NONE);<br />
</syntaxhighlight><br />
* DirectX Errors<br />
*: DirectX Utilities - Lookup Tool<br />
*: APIDisplay::restore() example<br />
<syntaxhighlight lang="cpp"><br />
bool APIDisplay::restore() {<br />
<br />
bool rc = false;<br />
<br />
if (d3dd) {<br />
HRESULT hr;<br />
hr = d3dd->TestCooperativeLevel();<br />
if (hr == D3DERR_DEVICENOTRESET)<br />
// reset the APIDisplay device<br />
rc = d3dd->Reset(&d3dpp) == D3D_OK;<br />
else if (hr == S_OK)<br />
rc = true;<br />
}<br />
if (rc) {<br />
// reacquire sprite manager references to video memory<br />
if (manager)<br />
manager->OnResetDevice();<br />
}<br />
<br />
// complete the restoration<br />
if (rc) {<br />
setupLighting();<br />
setupBlending();<br />
}<br />
<br />
return rc;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* meshes sample<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 Rob Whitaker on Skyboxes]<br />
* [http://web.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/suman_wk8_IBR.pdf Image Based Rendering - Suman Nadella on Billboarding and Imposters]<br />
* [http://www.digitalrune.com/Products/GameEngine/Particles.aspx DigitalRune]<br />
* [http://en.wikipedia.org/wiki/Mipmap Wikipedia on Texture Filtering]<br />
* [http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx D3D 9 tutorial on modeling with an Index list]<br />
<br />
== Week 5 - Feb 6 ==<br />
=== This Week ===<br />
* Vertex Declarations<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172559%28v=vs.85%29.aspx FVF Codes]<br />
<syntaxhighlight lang="cpp"><br />
template <class T = Vertex><br />
class APIVertexDeclaration {<br />
<br />
static D3DVERTEXELEMENT9 fmt[MAXD3DDECLLENGTH + 1];<br />
static unsigned vertexSize;<br />
<br />
public:<br />
static D3DVERTEXELEMENT9* format() { return fmt; }<br />
static unsigned size() { return vertexSize; }<br />
};<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<Vertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_NORMAL, 0},<br />
{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_TEXCOORD, 0}, <br />
D3DDECL_END()};<br />
<br />
template<><br />
unsigned APIVertexDeclaration<Vertex>::vertexSize = 32;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
<br />
template <><br />
D3DVERTEXELEMENT9 APIVertexDeclaration<LitVertex>::fmt[MAXD3DDECLLENGTH + 1]<br />
= {<br />
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_POSITION, 0},<br />
{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT,<br />
D3DDECLUSAGE_COLOR, 0},<br />
D3DDECL_END()};<br />
<br />
template <><br />
unsigned APIVertexDeclaration<LitVertex>::vertexSize = 16;<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172630%28v=vs.85%29.aspx D3DVERTEXELEMENT9 struct]<br />
* The Pipeline<br />
*: [http://en.wikipedia.org/wiki/Instruction_pipeline What is a pipeline]<br />
*:<br />
* The GPU<br />
*: [http://en.wikipedia.org/wiki/Graphics_processing_unit What is a GPU]<br />
** nVidia<br />
**: [http://en.wikipedia.org/wiki/Geforce GeForce]<br />
**: [http://en.wikipedia.org/wiki/NVIDIA_Quadro Quadro]<br />
**: [http://en.wikipedia.org/wiki/Nvidia_Tesla Tesla]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units Comparison]<br />
** AMD (previously ATI)<br />
**: [http://en.wikipedia.org/wiki/Radeon_R520 Radeon 520]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_AMD_graphics_processing_units Comparison]<br />
* Shader Languages<br />
*: [http://en.wikipedia.org/wiki/Shader what is a shader]<br />
*: dedicated shaders<br />
*: [http://en.wikipedia.org/wiki/Unified_shader_model unified shaders]<br />
*: how does a shader work<br />
** Languages<br />
**: [http://en.wikipedia.org/wiki/HLSL HLSL - Microsoft]<br />
**: [http://en.wikipedia.org/wiki/Cg_%28programming_language%29 Cg - nVidia]<br />
**: [http://en.wikipedia.org/wiki/GLSL GLSL - OpenGL (Khronos)]<br />
* Vertex Shaders<br />
* Pixel Shaders<br />
* effect of skybox and point light on frame rate<br />
<br />
=== To Do ===<br />
<br />
== Week 6 - Feb 13 ==<br />
=== This Week ===<br />
==== Vertex Shader Programming ====<br />
* Host<br />
: APIPlatformSettings.h - Vertex Shader Identification - select between fixed function and programmable pipelines here<br />
<syntaxhighlight lang="cpp"><br />
// shader file data<br />
#define VERTEX_SHADER_FILE L"vertexShader.hlsl"<br />
#define VERTEX_SHADER_ENTRY_POINT "vertexShader"<br />
</syntaxhighlight><br />
: APIBase.h - pointers into the shader - APIBase is the base class for the graphics API classes<br />
<syntaxhighlight lang="cpp"><br />
static IDirect3DVertexShader9* vertexShader; // vertex shader<br />
static ID3DXConstantTable* uniformVS; // for vertex shader<br />
</syntaxhighlight><br />
: APIBase.cpp - initialize the shader pointers<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DVertexShader9* APIBase::vertexShader = nullptr; // vertex shader<br />
ID3DXConstantTable* APIBase::uniformVS = nullptr; // for vertex shader<br />
</syntaxhighlight><br />
: APIDisplay.h - keeps track of the current projection matrix<br />
<syntaxhighlight lang="cpp"><br />
Matrix projection; // projection transformation<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup() - checks the shader version<br />
<syntaxhighlight lang="cpp"><br />
// points to compiled shader code<br />
LPD3DXBUFFER compiledCodeVS = nullptr;<br />
<br />
// check for minimum vertex shader version required<br />
if (caps.VertexShaderVersion < D3DVS_VERSION(2,0))<br />
error(L"APIDisplay::09 Device does not support vertex shader 2_0");<br />
</syntaxhighlight><br />
compiles the shader hlsl code, retrieves address of constant memory and vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// compile the vertex shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(VERTEX_SHADER_FILE, NULL,<br />
NULL, VERTEX_SHADER_ENTRY_POINT, D3DXGetVertexShaderProfile(d3dd),<br />
D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION,<br />
&compiledCodeVS, NULL, &uniformVS))) {<br />
release();<br />
error(L"APIDisplay::13 Unable to compile vertex shader");<br />
}<br />
// create the vertex shader object<br />
else if (FAILED(d3dd->CreateVertexShader(<br />
(DWORD*)compiledCodeVS->GetBufferPointer(), &vertexShader))) {<br />
compiledCodeVS->Release();<br />
release();<br />
error(L"APIDisplay::14 Unable to create vertex shader object");<br />
}<br />
else {<br />
compiledCodeVS->Release();<br />
</syntaxhighlight><br />
sets the current vertex shader<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetVertexShader(vertexShader);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setProjection() - stores the projection matrix<br />
<syntaxhighlight lang="cpp"><br />
this->projection = *((Matrix*)projection);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginDrawFrame() - copies the view matrix and the camera heading to constant memory<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewProjection = v * projection;<br />
uniformVS->SetMatrix(d3dd, "viewProjection",<br />
(D3DXMATRIX*)&viewProjection);<br />
Vector heading(v.m13, v.m23, v.m33);<br />
// Required for specular lighting calculations<br />
uniformVS->SetFloatArray(d3dd, "heading", (FLOAT*)&heading, 3);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformVS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformVS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - set() - copies the lighting state to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setWorld() - copies the world matrix to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetMatrix(d3dd, "world", (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity() - copies the reflectivity to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformVS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release() - releases constant memory and the vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// release the shader COM objects<br />
if (uniformVS) {<br />
uniformVS->Release();<br />
uniformVS = nullptr;<br />
}<br />
if (vertexShader) {<br />
vertexShader->Release();<br />
vertexShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APILight.cpp - setup() - copies the light properties to constant memory<br />
<syntaxhighlight lang="cpp"><br />
// Populate the vertex shader constant table<br />
//<br />
// Light descriptors within the vertex shader<br />
char typ[] = "light[0].type";<br />
char amb[] = "light[0].ambient";<br />
char dif[] = "light[0].diffuse";<br />
char spe[] = "light[0].specular";<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
char spt[] = "light[0].spot";<br />
char att[] = "light[0].attenuation";<br />
char ran[] = "light[0].range";<br />
//<br />
// Reset index in light descriptor<br />
typ[6] = index + '0';<br />
amb[6] = index + '0';<br />
dif[6] = index + '0';<br />
spe[6] = index + '0';<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
spt[6] = index + '0';<br />
att[6] = index + '0';<br />
ran[6] = index + '0';<br />
// Populate the vertex shader constant table<br />
Vector attenuation(attenuation0, attenuation1, attenuation2);<br />
Vector spot(cosf(phi/2), cosf(theta/2), falloff);<br />
Vector zero;<br />
uniformVS->SetInt(d3dd, typ, type);<br />
uniformVS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformVS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformVS->SetFloat(d3dd, ran, range);<br />
rc = true;<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn() - repositions the light and turns it on<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update() - repositions the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff() - turns off the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
uniformVS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APIGraphic.h - class APIXMesh - processes an X file mesh<br />
<syntaxhighlight lang="cpp"><br />
D3DXCOLOR* ambient;<br />
D3DXCOLOR* diffuse;<br />
D3DXCOLOR* specular;<br />
FLOAT* power;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh() - copy constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
: APIGraphic.cpp - operator=() = assignment operator<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
ambient = new D3DXCOLOR[src.nSubsets];<br />
diffuse = new D3DXCOLOR[src.nSubsets];<br />
specular = new D3DXCOLOR[src.nSubsets];<br />
power = new FLOAT[src.nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
ambient[i] = src.ambient[i];<br />
diffuse[i] = src.diffuse[i];<br />
specular[i] = src.specular[i];<br />
power[i] = src.power[i];<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - setup() -<br />
<syntaxhighlight lang="cpp"><br />
ambient = new D3DXCOLOR[nSubsets];<br />
diffuse = new D3DXCOLOR[nSubsets];<br />
specular = new D3DXCOLOR[nSubsets];<br />
power = new FLOAT[nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
ambient[i].r = matl[i].MatD3D.Diffuse.r * 0.7f;<br />
ambient[i].g = matl[i].MatD3D.Diffuse.g * 0.7f;<br />
ambient[i].b = matl[i].MatD3D.Diffuse.b * 0.7f;<br />
ambient[i].a = matl[i].MatD3D.Diffuse.a;<br />
diffuse[i] = matl[i].MatD3D.Diffuse; // reflected from lights<br />
specular[i] = matl[i].MatD3D.Specular; // shine from lights<br />
power[i] = matl[i].MatD3D.Power; // 0 if it shouldn't be shiny<br />
</syntaxhighlight><br />
: APIGraphic.cpp - draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformVS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawVertex holds the untransformed data for a single vertex<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for a single vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float4 colour : COLOR; // colour of the lit vertex<br />
float2 texCoord0 : TEXCOORD0; // texture coordinates - stage 0<br />
float2 texCoord1 : TEXCOORD1; // texture coordinates - stage 1<br />
};<br />
<br />
// Uniform Data (constant for a stream of vertices)<br />
//<br />
// Lighting<br />
float4 ambient; // global ambient light - always on<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // switches for static lights<br />
Material material; // material reflectivity<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw vertex and returns the transformed vertex<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed;<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
<br />
// not working<br />
if (litVertex) {<br />
transformed.colour.r = raw.normal.r;<br />
transformed.colour.g = raw.normal.g;<br />
transformed.colour.b = raw.normal.b;<br />
transformed.colour.a = 1.0f;<br />
}<br />
else {<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
<br />
// Determine the colour of the vertex from each light in turn<br />
//<br />
// Use the cosine of the angle between the worldNormal and the direction<br />
// of the light to determine the amount of reflected light. The cosine<br />
// is given by the dot product, if both vectors have been normalized. If<br />
// the cosine is less than 0, the angle is greater than 90 degrees and<br />
// no light is reflected. Use saturate() to implement this condition.<br />
//<br />
// A more efficient algorithm would supply the light direction already<br />
// converted to the local space of the vertex (by using the inverse of<br />
// the world transformation).<br />
//<br />
<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
float3 lightDirection, camera = normalize(heading);<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
<br />
for (int i = 0; i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
lightDirection = - normalize((light[i].type == POINT_LIGHT)?<br />
float3(worldPosition.x, worldPosition.y, worldPosition.z) -<br />
light[i].position : light[i].direction);<br />
diffuseFactor = saturate(dot(worldNormal, lightDirection));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
worldNormal - lightDirection), camera));<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length((float3)worldPosition - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(worldPosition.x, worldPosition.y,<br />
worldPosition.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(<br />
abs((rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit vertex<br />
//<br />
transformed.colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
<br />
// pass the diffuse alpha along as the alpha component<br />
//<br />
transformed.colour.w = material.diffuse.w;<br />
}<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord0 = raw.texCoord;<br />
transformed.texCoord1 = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
<br />
==== Fragment Shader ====<br />
* Host<br />
: APIPlatformSettings.h<br />
<syntaxhighlight lang="cpp"><br />
#define FRAGMENT_SHADER_FILE L"fragmentShader.hlsl"<br />
#define FRAGMENT_SHADER_ENTRY_POINT "fragmentShader"<br />
</syntaxhighlight><br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
// Fragment Shader Support<br />
static IDirect3DPixelShader9* fragmentShader; // fragment shader<br />
static ID3DXConstantTable* uniformFS; // for fragment shader<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DPixelShader9* APIBase::fragmentShader = nullptr; // fragment shader<br />
ID3DXConstantTable* APIBase::uniformFS = nullptr; // for fragment shader<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER compiledCodeFS = nullptr;<br />
<br />
// checks for minimum pixel shader version required<br />
else if (caps.PixelShaderVersion < D3DPS_VERSION(3,0))<br />
error(L"Display::10 Device does not support pixel shader 3_0");<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// compile the fragment shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(FRAGMENT_SHADER_FILE, NULL,<br />
NULL, FRAGMENT_SHADER_ENTRY_POINT, D3DXGetPixelShaderProfile(d3dd), 0,<br />
&compiledCodeFS, NULL, &uniformFS))) {<br />
release();<br />
error(L"APIDisplay::15 Unable to compile the fragment shader code");<br />
}<br />
// create the pixel shader object<br />
else if (FAILED(d3dd->CreatePixelShader(<br />
(DWORD*)compiledCodeFS->GetBufferPointer(), &fragmentShader))) {<br />
compiledCodeFS->Release();<br />
release();<br />
error(L"APIDisplay::16 Unable to create fragment shader object");<br />
}<br />
else {<br />
compiledCodeFS->Release();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172732%28v=vs.85%29.aspx D3DXCompileShaderFromFile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172870%28v=vs.85%29.aspx D3DXGetPixelShaderProfile()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::CreatePixelShader()]<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetPixelShader(fragmentShader);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174450%28v=vs.85%29.aspx IDirect3DDevice9::SetPixelShader()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformFS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformFS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205775%28v=vs.85%29.aspx ID3DXConstantTable::SetFloatArray()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205776%28v=vs.85%29.aspx ID3DXConstantTable::SetInt()]<br />
: APIDisplay.cpp - set()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205771%28v=vs.85%29.aspx ID3DXConstantTable::SetBool()]<br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformFS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
}<br />
if (uniformFS) {<br />
uniformFS->Release();<br />
uniformFS = nullptr;<br />
}<br />
if (fragmentShader) {<br />
fragmentShader->Release();<br />
fragmentShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
: APIGraphic.cpp - APIXMesh::draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformFS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205774%28v=vs.85%29.aspx ID3DXConstantTable::SetFloat()]<br />
: APILight.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetInt(d3dd, typ, type);<br />
uniformFS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformFS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformFS->SetFloat(d3dd, ran, range);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOn()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - update()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
: APILight.cpp - turnOff()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
: APITexture.cpp - attach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, true);<br />
</syntaxhighlight><br />
: APITexture.cpp - detach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, false);<br />
</syntaxhighlight><br />
* Device<br />
: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 viewPoint; // camera viewpoint for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define MTEXTURES 2<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of active lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
bool lighting; // lighting calculations on?<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
</syntaxhighlight><br />
: fragmentShader.hlsl - fragmentShader()<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
}<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
* reorganize framework code so that vertex shader receives product of world, view, and projection matrices<br />
** store viewProjection matrix as an instance variable in APIDisplay<br />
** pre-multiply viewProjection by world to obtain composite matrix to pass to vertex shader<br />
** add composite matrix to the constant table in the vertex shader<br />
* reorganize framework code to minimize duplication of heading normalization<br />
** perform normalization of heading in APIDisplay::beginDrawFrame()<br />
<br />
=== Resources ===<br />
<br />
== Week 7 - Feb 20 ==<br />
=== This Week ===<br />
* Effects Framework<br />
** techniques<br />
*: passes<br />
* Source Code<br />
: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
static ID3DXEffect* effect; // points to effects framework<br />
</syntaxhighlight><br />
: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
ID3DXEffect* APIBase::effect = nullptr; // effects framework<br />
</syntaxhighlight><br />
: APIDisplay.h<br />
<syntaxhighlight lang="cpp"><br />
// Effects Framework handles<br />
D3DXHANDLE viewProjection; // view * projection<br />
D3DXHANDLE viewPoint; // camera viewpoint<br />
D3DXHANDLE ambient; // global ambient color<br />
D3DXHANDLE ambientHandle; // current ambient reflectivity<br />
D3DXHANDLE diffuseHandle; // current diffuse reflectivity<br />
D3DXHANDLE specularHandle; // current specular reflectivity<br />
D3DXHANDLE powerHandle; // current shininess coefficient<br />
D3DXHANDLE worldHandle; // current world transformation<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
void beginEffect(const char*, unsigned&);<br />
void beginPass(unsigned);<br />
void endPass();<br />
void endEffect();<br />
</syntaxhighlight><br />
: APIDisplay.cpp - APIDisplay()<br />
<syntaxhighlight lang="cpp"><br />
viewProjection = nullptr;<br />
viewPoint = nullptr;<br />
ambient = nullptr;<br />
ambientHandle = nullptr;<br />
diffuseHandle = nullptr;<br />
specularHandle = nullptr;<br />
powerHandle = nullptr;<br />
worldHandle = nullptr;<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER errorBuffer = NULL;<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// create the effects framework<br />
else if (FAILED(D3DXCreateEffectFromFile(d3dd, EFFECT_FILE, 0,<br />
0, D3DXSHADER_DEBUG, 0, &effect, &errorBuffer))) {<br />
release();<br />
error(L"APIDisplay::17 Unable to create the effects framework");<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172768%28v=vs.85%29.aspx D3DXCreateEffectFromFile()]<br />
<syntaxhighlight lang="cpp"><br />
if (errorBuffer) errorBuffer->Release();<br />
viewProjection = effect->GetParameterByName(0, "viewProjection");<br />
viewPoint = effect->GetParameterByName(0, "viewPoint");<br />
ambient = effect->GetParameterByName(0, "ambient");<br />
worldHandle = effect->GetParameterByName(0, "world");<br />
ambientHandle = effect->GetParameterByName(0, "material.ambient");<br />
diffuseHandle = effect->GetParameterByName(0, "material.diffuse");<br />
specularHandle = effect->GetParameterByName(0, "material.specular");<br />
powerHandle = effect->GetParameterByName(0, "material.power");<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205696%28v=vs.85%29.aspx GetParameterByName()]<br />
: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewprojection = v * projection;<br />
Vector heading(v.m13, v.m23, v.m33);<br />
effect->SetMatrix(viewProjection, (D3DXMATRIX*)&viewprojection);<br />
effect->SetVector(viewPoint, (D3DXVECTOR4*)&heading);<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205720%28v=vs.85%29.aspx SetMatrix()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205729%28v=vs.85%29.aspx SetVector()]<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
effect->SetVector(ambient, (D3DXVECTOR4*)&colour);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - beginEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginEffect(const char* technique, unsigned& nPasses) {<br />
<br />
D3DXHANDLE techniqueHandle = effect->GetTechniqueByName(technique);<br />
effect->SetTechnique(techniqueHandle);<br />
effect->Begin(&nPasses, 0);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205706%28v=vs.85%29.aspx GetTechniqueByName()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205834%28v=vs.85%29.aspx SetTechnique()]<br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205815%28v=vs.85%29.aspx Begin()]<br />
: APIDisplay.cpp - beginPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::beginPass(unsigned i) {<br />
<br />
effect->BeginPass(i);<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205817%28v=vs.85%29.aspx BeginPass()]<br />
: APIDisplay.cpp - endPass()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endPass() {<br />
<br />
effect->EndPass();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205823%28v=vs.85%29.aspx EndPass()]<br />
: APIDisplay.cpp - endEffect()<br />
<syntaxhighlight lang="cpp"><br />
void APIDisplay::endEffect() {<br />
<br />
effect->End();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205821%28v=vs.85%29.aspx End()]<br />
: APIDisplay.cpp - setWorld()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetMatrix(worldHandle, (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
effect->SetVector(ambientHandle, (D3DXVECTOR4*)&r.ambient);<br />
effect->SetVector(diffuseHandle, (D3DXVECTOR4*)&r.diffuse);<br />
effect->SetVector(specularHandle, (D3DXVECTOR4*)&r.specular);<br />
effect->SetFloat(powerHandle, r.power);<br />
effect->CommitChanges();<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb205819%28v=vs.85%29.aspx CommitChanges()]<br />
: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
if (effect) {<br />
effect->Release();<br />
effect = NULL;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float3 ambient; <br />
float3 diffuse;<br />
float3 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of static lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
// Types<br />
//<br />
// RawVertex holds the original data for a vertex in the stream<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD0; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for the vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
float3 worldPos : TEXCOORD1; // position in world space<br />
float3 worldNor : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for the stream of vertices)<br />
//<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float4 viewPoint; // camera viewpoint for specular calcs<br />
// Geometry<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
: effects.fx - VertexShader<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw data for a vertex and transforms that data<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed; // result returned by this function<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
transformed.worldPos = worldPosition.xyz;<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
transformed.worldNor = worldNormal;<br />
<br />
// Determine the direction from the camera's viewpoint to this vertex for<br />
// subsequent lighting calculations<br />
//<br />
transformed.toViewer = normalize(viewPoint - worldPosition.xyz);<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - FragmentShader<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
: effects.fx - technique opaque<br />
<syntaxhighlight lang="cpp"><br />
technique opaque {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
: effects.fx - technique translucent<br />
<syntaxhighlight lang="cpp"><br />
technique translucent {<br />
<br />
pass {<br />
VertexShader = compile vs_3_0 vertexShader();<br />
PixelShader = compile ps_3_0 fragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
</syntaxhighlight><br />
=== To Do ===<br />
=== Resources ===<br />
<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* Frank Luna's notes for DirectX10 (page 306)<br />
:[http://books.google.ca/books?id=AyACb-t8E-MC&pg=PA306&lpg=PA306#v=onepage&q&f=false Environment Maps](Google books)<br />
:[http://libcat.senecac.on.ca/vwebv/holdingsInfo?searchId=19588&recCount=50&recPointer=2&bibId=261220 Environment Maps](Seneca ELibraray) <br />
* Design.cpp<br />
: Design::initialize() - create the skybox object<br />
<syntaxhighlight lang="cpp"><br />
// initialize initializes the general display design coordinator, creates the<br />
// primitive sets, textures, objects, lights, sounds, cameras, and text items<br />
//<br />
void Design::initialize() {<br />
<br />
// ...<br />
<br />
// create textures<br />
iTexture* sunset = CreateCubeTexture(L"Islands.dds");<br />
<br />
// ...<br />
<br />
iObject* skybox = CreateSkybox();<br />
skybox->rotatex(-1.5708f);<br />
skybox->attach(sunset);<br />
setSkybox(skybox);<br />
<br />
// ...<br />
}<br />
</syntaxhighlight><br />
* Coordinator.cpp<br />
: Coordinator::render() - using different techniques for different objects<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render() {<br />
<br />
// adjust framecount and fps<br />
if (now - lastReset <= unitsPerSec)<br />
framecount++;<br />
else {<br />
// recalculate the frame rate<br />
fps = framecount * unitsPerSec / (now - lastReset);<br />
framecount = 0;<br />
lastReset = now;<br />
if (timerText) {<br />
wchar_t str[MAX_DESC + 1];<br />
sprintf(str, fps, L" fps");<br />
timerText->set(str);<br />
}<br />
}<br />
// update the user input devices<br />
userInput->update();<br />
Coordinator::update();<br />
// update the model<br />
update();<br />
// update the audio<br />
audio->setVolume(volume);<br />
audio->setFrequencyRatio(frequency);<br />
audio->update(Camera::getView());<br />
<br />
// start rendering<br />
display->beginDrawFrame(Camera::getView());<br />
display->setAmbientLight(ambient.r, ambient.g, ambient.b);<br />
unsigned nPasses;<br />
// render all of the opaque unlit objects<br />
display->beginEffect("opaque", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(OPAQUE_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the translucent unlit objects<br />
display->beginEffect("translucent", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(TRANSLUCENT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render all of the lit objects<br />
display->beginEffect("litObjects", nPasses);<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(LIT_OBJECT);<br />
display->endPass();<br />
}<br />
display->endEffect();<br />
// render the skybox<br />
display->beginEffect("skybox", nPasses);<br />
if (background && !skybox) {<br />
Rectf fullScreen(0, 0, 1, 1);<br />
display->beginDrawHUD(0);<br />
background->render(fullScreen, true);<br />
display->endDrawHUD();<br />
}<br />
else if (skybox) {<br />
for (unsigned i = 0; i < nPasses; i++) {<br />
display->beginPass(i);<br />
render(SKYBOX);<br />
display->endPass();<br />
}<br />
}<br />
display->endEffect();<br />
display->set(ALPHA_BLEND, false);<br />
display->beginDrawHUD(HUD_ALPHA);<br />
render(ALL_HUDS);<br />
display->endDrawHUD();<br />
display->endDrawFrame();<br />
render(ALL_SOUNDS);<br />
}<br />
</syntaxhighlight><br />
: Coordinator::render(iObject*) - render a single object one subset at a time<br />
<syntaxhighlight lang="cpp"><br />
void Coordinator::render(iObject* object) {<br />
<br />
display->setWorld(&object->world());<br />
unsigned nSubsets = object->noSubsets();<br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
iTexture* texture = object->getTexture(i);<br />
if (texture) texture->attach();<br />
display->setReflectivity(object->getReflectivity(i));<br />
object->render(i);<br />
if (texture) texture->detach();<br />
}<br />
}<br />
</syntaxhighlight><br />
* Skybox class<br />
: iObject interface - CreateSkybox declaration<br />
<syntaxhighlight lang="cpp"><br />
class iObject : public Shape, public Base {<br />
public:<br />
// initialization<br />
virtual void attach(iTexture* t) = 0;<br />
virtual void attach(iTexture** t) = 0;<br />
// execution<br />
virtual unsigned noSubsets() const = 0;<br />
virtual void render(unsigned) = 0;<br />
virtual void setTextureFilter(unsigned) = 0;<br />
virtual iTexture* getTexture(unsigned) const = 0;<br />
virtual const void* getReflectivity(unsigned) const = 0;<br />
virtual bool belongsTo(Category category) const = 0;<br />
};<br />
<br />
iObject* CreateObject(iGraphic*, const Reflectivity* = nullptr, unsigned = 1u);<br />
iObject* CreateBillboard(BillboardType, iGraphic*,<br />
const Reflectivity* = nullptr);<br />
iObject* CreateSkybox();<br />
<br />
iObject* Clone(const iObject*);<br />
</syntaxhighlight><br />
: Skybox class - derived from Object<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
// A Skybox is an inverted Object that translates with the viewpoint<br />
//<br />
class Skybox : public Object {<br />
<br />
public:<br />
Skybox();<br />
void render(unsigned);<br />
};<br />
</syntaxhighlight><br />
: CreateSkybox<br />
<syntaxhighlight lang="cpp"><br />
iObject* CreateSkybox() {<br />
<br />
return new Skybox();<br />
}<br />
</syntaxhighlight><br />
: Skybox::Skybox - SKYBOX category, 2 x 2 x 2 cube<br />
<syntaxhighlight lang="cpp"><br />
Skybox::Skybox() : Object(SKYBOX, CreateIBox(-1, -1, -1 * MODEL_Z_AXIS, 1, 1,<br />
1 * MODEL_Z_AXIS)) {<br />
}<br />
</syntaxhighlight><br />
: Skybox::render(unsigned) - move skybox centroid to current camera position<br />
<syntaxhighlight lang="cpp"><br />
void Skybox::render(unsigned) {<br />
<br />
Camera* camera = *(Camera**)(Camera::getCurrent());<br />
Vector disp = camera->position() - position();<br />
translate(disp.x, disp.y, disp.z);<br />
<br />
Object::render(0);<br />
}<br />
</syntaxhighlight><br />
* Texture class<br />
: iTexture interface - CreateCubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iTexture : public Base {<br />
public:<br />
virtual void attach() const = 0;<br />
virtual void setFilter(unsigned) const = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, bool = false) = 0;<br />
};<br />
<br />
iTexture* CreateTexture(const wchar_t* file, unsigned filter = 0);<br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter = 0);<br />
<br />
iTexture* Clone(const iTexture*);<br />
</syntaxhighlight><br />
: Texture class - add the cube parameter to constructor<br />
<syntaxhighlight lang="cpp"><br />
class Texture : public iTexture {<br />
<br />
iAPITexture* apiTexture; // points to the api texture<br />
<br />
Texture(const Texture&);<br />
virtual ~Texture();<br />
<br />
public:<br />
Texture(const wchar_t* file, unsigned filter = 0, bool cube = false);<br />
Texture& operator=(const Texture&);<br />
void* clone() const { return new Texture(*this); }<br />
// execution<br />
void attach() const;<br />
void setFilter(unsigned) const;<br />
void detach();<br />
void render(const Rectf&, bool);<br />
// termination<br />
void suspend();<br />
void release();<br />
};</syntaxhighlight><br />
: CreateCubeTexture - call constructor with true flag for cube<br />
<syntaxhighlight lang="cpp"><br />
iTexture* CreateCubeTexture(const wchar_t* file, unsigned filter) {<br />
<br />
return new Texture(file, filter, true);<br />
}<br />
</syntaxhighlight><br />
: Texture::Texture() - create APICubeTexture()<br />
<syntaxhighlight lang="cpp"><br />
Texture::Texture(const wchar_t* file, unsigned filter, bool cube) {<br />
<br />
coordinator->add(this);<br />
<br />
wchar_t* fileWithPath = nullptr;<br />
if (file) {<br />
// add the directory to create the relative filename<br />
int len = strlen(file) + strlen(TEXTURE_DIRECTORY) + 1;<br />
fileWithPath = new wchar_t[len + 1];<br />
::nameWithDir(fileWithPath, TEXTURE_DIRECTORY, file, len);<br />
}<br />
<br />
// apiTexture on the graphics device<br />
if (cube)<br />
apiTexture = CreateAPICubeTexture(fileWithPath);<br />
else<br />
apiTexture = CreateAPITexture(fileWithPath, filter);<br />
<br />
if (fileWithPath) delete [] fileWithPath;<br />
}<br />
</syntaxhighlight><br />
: iAPITexture interface - add CreateAPICubeTexture declaration<br />
<syntaxhighlight lang="cpp"><br />
class iAPITexture {<br />
public:<br />
virtual iAPITexture* clone() const = 0;<br />
// execution<br />
virtual void attach() = 0;<br />
virtual void setFilter(unsigned flags) = 0;<br />
virtual void detach() = 0;<br />
virtual void render(const Rectf&, unsigned char, bool = false) = 0;<br />
// termination<br />
virtual void suspend() = 0;<br />
virtual void release() = 0;<br />
virtual void Delete() const = 0;<br />
};<br />
<br />
iAPITexture* CreateAPITexture(const wchar_t* file, unsigned filter);<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file);<br />
</syntaxhighlight><br />
* APITexture.h<br />
: APICubeTexture class definition<br />
<syntaxhighlight lang="cpp"><br />
class APICubeTexture : public iAPITexture, public APIBase {<br />
<br />
wchar_t* file; // points to file with texture image<br />
unsigned filter; // default texture filtering flags<br />
<br />
IDirect3DCubeTexture9* tex; // interface to texture COM object<br />
<br />
virtual ~APICubeTexture();<br />
<br />
void setup();<br />
<br />
public:<br />
APICubeTexture(const wchar_t* file);<br />
APICubeTexture(const APICubeTexture&);<br />
iAPITexture& operator=(const APICubeTexture&);<br />
iAPITexture* clone() const { return new APICubeTexture(*this); }<br />
// execution<br />
void attach();<br />
void setFilter(unsigned filter) {}<br />
void detach();<br />
void render(const Rectf&, unsigned char, bool) {}<br />
// suspension<br />
void suspend();<br />
// termination<br />
void release();<br />
void Delete() const { delete this; }<br />
};<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb174329%28v=vs.85%29.aspx IDirect3DCubeTexture9 interface]<br />
: APICubeTexture class implementation<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- APICubeTexture -----------------------------<br />
//<br />
// The APICubeTexture class implements a texture at the API level<br />
//<br />
iAPITexture* CreateAPICubeTexture(const wchar_t* file) {<br />
<br />
return new APICubeTexture(file);<br />
}<br />
<br />
// constructor initializes the texture identifier<br />
//<br />
APICubeTexture::APICubeTexture(const wchar_t* file) {<br />
<br />
if (file) {<br />
int len = strlen(file);<br />
this->file = new wchar_t[len + 1];<br />
strcpy(this->file, file, len);<br />
}<br />
else<br />
this->file = nullptr;<br />
<br />
tex = nullptr;<br />
}<br />
<br />
APICubeTexture::APICubeTexture(const APICubeTexture& src) {<br />
<br />
file = nullptr;<br />
tex = nullptr;<br />
*this = src; <br />
}<br />
<br />
iAPITexture& APICubeTexture::operator=(const APICubeTexture& src) {<br />
<br />
if (this != &src) {<br />
if (file)<br />
delete [] file;<br />
if (src.file) {<br />
int len = strlen(src.file);<br />
file = new wchar_t[len + 1];<br />
strcpy(file, src.file, len);<br />
}<br />
else<br />
file = nullptr;<br />
suspend();<br />
tex = nullptr;<br />
}<br />
<br />
return *this;<br />
}<br />
<br />
// setup creates the api texture from the texture file<br />
//<br />
void APICubeTexture::setup() {<br />
<br />
// create a texture COM object from the texture file<br />
//<br />
HRESULT hr;<br />
if (file && FAILED(hr = D3DXCreateCubeTextureFromFileEx(d3dd, file,<br />
0, D3DX_DEFAULT, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT,<br />
D3DX_DEFAULT, 0, nullptr, nullptr, &tex))) {<br />
error(L"APICubeTexture::11 Failed to create texture COM object from file");<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// attach attaches the api texture to sampling stage i<br />
//<br />
void APICubeTexture::attach() {<br />
<br />
if (!tex) setup();<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, tex);<br />
}<br />
<br />
// detach detaches the api texture from sampling stage 0<br />
//<br />
void APICubeTexture::detach() {<br />
<br />
if (tex)<br />
d3dd->SetTexture(0, nullptr);<br />
}<br />
<br />
// suspend releases the api texture<br />
//<br />
void APICubeTexture::suspend() {<br />
<br />
// release the Interface to the texture COM object<br />
if (tex) {<br />
tex->Release();<br />
tex = nullptr;<br />
}<br />
}<br />
<br />
// releases suspends the api texture<br />
//<br />
void APICubeTexture::release() {<br />
<br />
suspend();<br />
}<br />
<br />
// destructor releases the api texture<br />
//<br />
APICubeTexture::~APICubeTexture() {<br />
<br />
release();<br />
}<br />
</syntaxhighlight><br />
:: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172757%28v=vs.85%29.aspx D3DXCreateCubeTextureFromFileEx]<br />
* effects.fx<br />
: vertex shader outpu structure<br />
<syntaxhighlight lang="cpp"><br />
//-------------------------------- Skybox -------------------------------------<br />
//<br />
struct FS_Skybox {<br />
float4 pos : POSITION;<br />
float3 tex : TEXCOORD0;<br />
};<br />
</syntaxhighlight><br />
: vertex shader<br />
<syntaxhighlight lang="cpp"><br />
FS_Skybox skyboxVertexShader(float3 pos : POSITION) {<br />
FS_Skybox output = (FS_Skybox) 0;<br />
output.pos = mul(float4(pos, 0), world);<br />
output.pos = mul(output.pos, viewProjection).xyww;<br />
output.tex = pos.xzy;<br />
return output;<br />
}<br />
</syntaxhighlight><br />
: skybox sampler state<br />
<syntaxhighlight lang="cpp"><br />
texture skyBox;<br />
samplerCUBE skySampler = sampler_state {<br />
texture = <skyBox>;<br />
MagFilter = LINEAR;<br />
Minfilter = LINEAR;<br />
Mipfilter = LINEAR;<br />
AddressU = MIRROR;<br />
AddressV = MIRROR;<br />
AddressW = MIRROR;<br />
};<br />
</syntaxhighlight><br />
: fragment shader<br />
<syntaxhighlight lang="cpp"><br />
float4 skyboxFragmentShader(FS_Skybox input) : COLOR0 {<br />
return texCUBE(skySampler, input.tex);<br />
}<br />
</syntaxhighlight><br />
: skybox technique<br />
<syntaxhighlight lang="cpp"><br />
technique skybox {<br />
<br />
pass {<br />
AlphaBlendEnable = false;<br />
ZENABLE = true;<br />
ZWRITEENABLE = false;<br />
CullMode = None;<br />
VertexShader = compile vs_3_0 skyboxVertexShader();<br />
PixelShader = compile ps_3_0 skyboxFragmentShader();<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 RB Whitaker's notes on skyboxes]<br />
* [http://knol.google.com/k/3d-skybox# Koen Samyn's knol]<br />
* [http://www.gameengineer.net/samples-graphics.html Game Engineer's demo]<br />
* [http://www.planetside.co.uk/terragen Terragen Texture Tool]<br />
* DirectX Utility - DirectX Texture Tool<br />
<br />
<!--<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* [http://msdn.microsoft.com/en-us/library/bb147178%28v=VS.85%29.aspx Mathematics of Lighting]<br />
* Lighting in Vertex Shaders<br />
** Notation<br />
**: G<sub>a</sub> - global ambient color<br />
**: C<sub>a</sub> - material ambient color<br />
**: C<sub>d</sub> - material diffuse color<br />
**: C<sub>s</sub> - material specular color<br />
**: L<sub>a<sub>i</sub></sub> - ambient color of light i<br />
**: L<sub>d<sub>i</sub></sub> - diffuse color of light i<br />
**: L<sub>s<sub>i</sub></sub> - specular color of light i<br />
**: L<sub>dir<sub>i</sub></sub> - direction vector of light i<br />
**: N - normal to the surface at the vertex<br />
*** [http://msdn.microsoft.com/en-us/library/bb172279%28v=VS.85%29.aspx Attenuation and Spotlight Factors]<br />
**** Atten<sub>i</sub> - attenuation of light i<br />
***: d<sub>i</sub> - distance from light i<br />
***:: d<sub>i</sub> = |L<sub>dir<sub>i</sub></sub>|<br />
***: a<sub>0</sub> - constant attenuation factor<br />
***: a<sub>1</sub> - linear attenuation factor<br />
***: a<sub>2</sub> - quadratic attenuation factor<br />
***: Atten<sub>i</sub> = 1/(a<sub>0</sub> + a<sub>1</sub> d<sub>i</sub> + a<sub>2</sub> d<sub>i</sub><sup>2</sup>)<br />
***: Atten<sub>i</sub> = [0, 1]<br />
**** Spot<sub>i</sub> - spot factor of light i<br />
***: Spot<sub>i</sub> = {[r<sub>i</sub> - cos(phi<sub>i</sub>/2)]/[cos(theta<sub>i</sub>/2) - cos(phi<sub>i</sub>/2)]}<sup>f<sub>i</sub></sup><br />
***: r<sub>i</sub> - cosine of angle from axis of spotlight<sub>i</sub><br />
***:: r<sub>i</sub> = norm(- light direction in camera space) . norm(L<sub>dir<sub>i</sub></sub>)<br />
***: phi<sub>i</sub> - penumbra (exterior cone) angle of spotlight<sub>i</sub><br />
***: theta<sub>i</sub> - umbra (interior cone) angle of spotlight<sub>i</sub><br />
***: f<sub>i</sub> - falloff factor of spotlight<sub>i</sub><br />
** [http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model Blinn-Phong and Phong]<br />
**: V - viewpoint vector<br />
**:: V = norm(Camera<sub>position</sub> - Vertex<sub>position</sub>)<br />
** Phong - account accurately for position of viewer<br />
**: Specular reflectance = (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup><br />
**: R<sub>i</sub> - reflection vector<br />
**:: R<sub>i</sub> = 2 * (N . L<sub>dir<sub>i</sub></sub>) N - L<sub>dir<sub>i</sub></sub><br />
**: p<sub>i</sub> - true specular power of light i<br />
**:<br />
** Blinn-Phong - use halfway vector instead of reflection vector - adjust power to compensate<br />
**: Specular reflectance = (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup><br />
**: H<sub>i</sub> - halfway vector<br />
**:: H<sub>i</sub> = norm(V + L<sub>dir<sub>i</sub></sub>)<br />
**:: H<sub>i</sub> = norm([0,0,1] + L<sub>dir<sub>i</sub></sub>) - less computationally intensive - assumes that camera is at infinity along z axis<br />
**: p'<sub>i</sub> - adjusted specular power of light i<br />
**:<br />
** [http://msdn.microsoft.com/en-us/library/bb172256%28v=VS.85%29.aspx Ambient]<br />
**: C<sub>a</sub> * ( G<sub>a</sub> + sum [L<sub>a<sub>i</sub></sub> * Atten<sub>i</sub> * Spot<sub>i</sub>] )<br />
** [http://msdn.microsoft.com/en-us/library/bb219656%28v=VS.85%29.aspx Diffuse]<br />
**: C<sub>d</sub> * sum [ L<sub>d<sub>i</sub></sub> * (N . L<sub>dir<sub>i</sub></sub>) * Atten<sub>i</sub> * Spot<sub>i</sub> ]<br />
** [http://msdn.microsoft.com/en-us/library/bb147399%28VS.85%29.aspx Specular]<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Blinn-Phong<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Phong<br />
** [http://msdn.microsoft.com/en-us/library/ff471376%28v=vs.85%29.aspx HLSL Intrinsic Functions]<br />
*** [http://msdn.microsoft.com/en-us/library/bb509630%28v=vs.85%29.aspx normalize()] - normalize a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509594%28v=vs.85%29.aspx dot(,)] - dot product of two vectors of any size<br />
*** [http://msdn.microsoft.com/en-us/library/bb509617%28v=vs.85%29.aspx length()] - length of a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509645%28v=vs.85%29.aspx saturate()] - clamp scalar, vector, or matrix to [0, 1]<br />
=== To Do ===<br />
=== Resources ===<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter&diff=82552SQLite Adapter2012-03-06T16:08:00Z<p>Gbatumbya: /* Contributors */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express SQLite]]<br />
<br />
<big><big> SQLite Adapter for NexJ </big></big><br />
<br />
<br />
== Project Goal ==<br />
Develop an adapter to enable NexJ Express's model interaction with SQLite databases.<br />
<!--<br />
=== Software Design Document ===<br />
[https://docs.google.com/document/d/1aX9YqdXcABKmxegTcovyZXqWYp_9NnPmke6QU8jfiBU/edit?hl=en_US Read only]<br />
--><br />
<br />
<br />
=== Contributors ===<br />
* [[User:Cwdesautels|Carl Desautels]]<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Abhishekbh|Abhishek Bhatnagar]]<br />
* [[User:Wei.song | Wei Song]]<br />
<br />
=== Supported Versions ===<br />
* sqlite.3.7.10 <br />
** Compiled with the following flags:<br />
***SQLITE_ENABLE_LOAD_EXTENSION=1<br />
***SQLITE_ENABLE_UPDATE_DELETE_LIMIT<br />
***SQLITE_ENABLE_COLUMN_METADATA<br />
***SQLITE_CORE<br />
***SQLITE_ENABLE_FTS4<br />
***SQLITE_ENABLE_FTS3_PARENTHESIS<br />
***SQLITE_ENABLE_RTREE<br />
***SQLITE_ENABLE_STAT3<br />
***SQLITE_SOUNDEX=1<br />
***SQLITE_MAX_VARIABLE_NUMBER=4000<br />
***SQLITE_USE_URI<br />
***SQLITE_ENABLE_ICU<br />
<br />
== Project Status==<br />
* '''Current Sprint''' : [[SQLite_Adapter#Sprint_3 | 3]]<br />
* [[SQLite_Adapter_StandUp_Reports | Stand Up Reports]]<br />
<br />
<br />
== Project Backlog ==<br />
=== Investigation (DONE) ===<br />
* Research SQLite / JDBC driver<br />
* Get requirements from NexJ (Meeting Friday Sept 23rd)<br />
* [[SQLite_Adapter_Research | Research Summary]]<br />
<br />
<br />
=== Sprint: 1 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
|Initial skeleton of the SQLite adapter<br />
|2<br />
|Running the jUnit test shows in the console that the adapter is loaded an running.<br />
|-<br />
|Use database schema tool to generate the SQL to setup the database<br />
|1<br />
|Running the DB Schema Tool's "setup" command, appropriate artifacts are created (e.g. sql or bat script) for generating the SQLite database.<br />
|-<br />
|Use database schema tool to generate the SQL to create the Core datasource's tables<br />
|5<br />
|Running the DB Schema Tool's "create" command, appropriate artifacts are created (e.g. a sql file) for creating the tables in an existing SQLite database.<br />
|}<br />
<br />
<br />
=== Sprint 2 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Use data schema tool to generate the SQL to insert the data from a dump file<br />
| 0<br />
| Running the DB schema Tool's 'insert' command, appropriate artifacts are created in the database<br />
|-<br />
| Use the scheme console to insert into and read from the database<br />
| 0<br />
| Running the schema console, perform multi-transactional inserts with commits and rollbacks. Reading from the database to confirm updates<br />
|-<br />
| Use the data load tool to extract information in a SQLite database and persist it to a dump file<br />
| 0<br />
| Running the data load tool, read information from the database and export it to a dump file<br />
|-<br />
| Use the database schema tool to create an insert script for all the instances in in a SQLite database<br />
| 0<br />
| Running the data load tool, read in information from a dump file<br />
|-<br />
| Add an attribute to the User class, add the column to the datasource and Main.upgrade. Use the data load tool to upgrade the SQLite database. The database now has the new column add to the User Table<br />
| 3<br />
| Running the database schema tool alter the user class and perform an upgrade<br />
|-<br />
| Run each of the data load tool commands to validate their use<br />
| 5<br />
| Running all of the data load tool's commands, checking for expected results<br />
|-<br />
| Run each of the database schema tool commands to validate their use<br />
| 5<br />
| Running all of the database schema tools commands, checking for expected results<br />
|}<br />
<br />
<br />
=== Sprint 3 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Retrieve a record using fulltext search in the where clause<br />
| 0<br />
| Using the SQlite Adapter perform a query to verify the full test search options have been configured properly<br />
|-<br />
| Demonstrate unicode support in sqlite functions<br />
| 5<br />
| Using the SQlite Adapter perform a query to verify unicode support is as expected in sqlite functions<br />
|-<br />
| Run all SQLiteSchemaManager unit tests, to validate correctness<br />
| 2<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|-<br />
| Run all the SQLiteAdapter unit tests, to validate correctness<br />
| 7<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|}<br />
<br />
<br />
== Project Repository ==<br />
* Central: https://bitbucket.org/cwdesautels/nexj-express-sqlite-adapter<br />
<br />
<br />
== Building JDBC from source ==<br />
* [[SQLite_Xerial_JDBC_From_Source | HowTo]] <br />
<br />
<br />
== Resources ==<br />
* Dowloads:<br />
** http://www.sqlite.org/download.html<br />
* Documentation:<br />
** Root - http://www.sqlite.org/docs.html<br />
** About - http://www.sqlite.org/about.html<br />
** Types - http://www.sqlite.org/datatype3.html<br />
** Limits - http://www.sqlite.org/limits.html<br />
** Null Handling - http://www.sqlite.org/nulls.html<br />
** Omitted Features - http://www.sqlite.org/omitted.html<br />
** SQL to SQLite - http://www.sqlite.org/lang_expr.html<br />
** API - http://www.sqlite.org/c3ref/intro.html<br />
* QuickStart:<br />
** Usage - http://www.sqlite.org/cintro.html<br />
** C Interface - http://www.sqlite.org/cintro.html<br />
* SQLite JDBC Driver:<br />
** (Unoffical) http://www.xerial.org/trac/Xerial</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=82498SQLite Adapter StandUp Reports2012-03-05T13:25:01Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
--><br />
<br />
=Week 9: Mar 5=<br />
<!--<br />
==Thursday==<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 8: Feb 27=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Built SQLite library on Linux with ICU statically linked<br />
* Started on extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
* Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Extension to enhance locale support in SQLite<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A<br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=81790SQLite Adapter StandUp Reports2012-02-23T16:56:55Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
=Week 9: Mar 5=<br />
=Week 8: Feb 27=<br />
--><br />
=Week 7: Feb 20=<br />
<br />
== Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
*Fixed building of SQLite libraries on Windows<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
== Monday ==<br />
N/A <br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension selection logic<br />
* Project planning<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Confirm linux behaviour of system properties<br />
* Alter driver pom.xml / makefile to our use prebuild binaries<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=PostgreSQL_Adapter&diff=81607PostgreSQL Adapter2012-02-17T16:24:32Z<p>Gbatumbya: /* Project Repository */</p>
<hr />
<div><big><big> PostgreSQL Adapter for NexJ </big></big><br />
{{NexJ_Express Index}}<br />
[[category: NexJ Past Projects]]<br />
[[category: NexJ Express PostgreSQL]]<br />
<br />
<br />
== Project Goal==<br />
Develop an adapter to enable NexJ Express model to interact with PostgreSQL database.<br />
<br />
===Contributors===<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[Minooz/Projects | Minoo Ziaei]]<br />
* [[User:AnastasiaS | Anastasia Semionova]]<br />
<br />
<br />
=== Supported PostgreSQL Versions===<br />
* 8.4+<br />
<br />
<br />
== Current Status==<br />
* '''Completed''' (October 21, 2011)<br />
* Get the last PostgreSQL adapter source code from http://mercurial.nexj.com/express.cgi/core<br />
<br />
<!--{|class="collapsible collapsed" style="border-style:solid;border-width:thin;border-color:black"<br />
!align="left" style="background-color:SteelBlue; font-weight:bold;border-style:solid;border-width:thin;padding: 2px 2px 2px 2px;"| Dec 2010 <br />
|- <br />
|<br />
* Database 'test' is created in Postgre.<br />
* sample table 'mutex' is created for testing the connection properties. <br />
* No need for SET SQL mode in Postgre<br />
* Creating tables in process <br />
* Tables are created.<br />
* Creating indexes and triggers in process<br />
|}<br />
<br />
{|class="collapsible collapsed" style="border-style:solid;border-width:thin;border-color:black"<br />
!align="left" style="background-color:SteelBlue; font-weight:bold;border-style:solid;border-width:thin;padding: 2px 2px 2px 2px;"| Nov 2010 <br />
|-<br />
|<br />
* Walk through parts of code related to SQLadapter, SqlSchemaManger and setup scripts in NexJ Express code<br />
* SQLAdapter (src, test) and SQLSchemaManager (src, test) classes are extended to create PostgreSQL classes<br />
* Proper PostgreSQL Driver is installed.<br />
* Postgre package url for XADataSource is added to the related files.<br />
* cofig and connection files are modified based on Postgre properties<br />
* Application is now connected to the Postgre database.<br />
|}<br />
--><br />
<br />
==Project Phases==<br />
=== Phase 1: Investigation (DONE) ===<br />
* Get requirements from NexJ (Meeting on Friday Nov 5th)<br />
* Walk-through the code<br />
* Familiarization with PostgreSQL<br />
<br />
=== Phase 2: Connect to PostgreSQL server (DONE) ===<br />
* [[NexJ_Express_Connecting_to_PostgreSQL| Connect to PostgreSQL server]]<br />
<br />
=== Phase 3: PostgreSQLSchemaManager (DONE) ===<br />
* Estimated Duration: 3 weeks (Jan 17 - Feb 11, 2011)<br />
* [[PostgreSQL Adapter-nexj/extendingSchemaManager | Extending SQLSchemaManager ]]<br />
<br />
=== Phase 4: PostgreSQLAdapter (DONE)===<br />
* Estimated Duration: 3 weeks (Feb 14 - 25, 2011)<br />
* [[PostgreSQL_Adapter-nexj/extendingSQLAdapter | Extending SQLAdapter ]]<br />
<br />
===Phase 5: PostgreSQL UnitTests and Optimization (DONE) ===<br />
* Estimated Duration: 2 weeks (Feb 28 - Mar 11, 2016)<br />
* Add database specific tests fostr PostgreSQL<br />
*:test for required contrib scripts<br />
*:test for custom blob read & write functions<br />
* Add PostgreSQL specific optimization<br />
<br />
===Phase 6: Megre Code with Latest Revision (DONE) ===<br />
* Merge code with lastest revision from http://mercurial.nexj.com/express<br />
<br />
===Phase 7: Test with NexJ Express Studio (DONE) ===<br />
* Estimated duration: Mar 7- Apr 14, 2011<br />
* Run model in Express studio using the postgresql adapter<br />
* create scripts for database initialization, creation and dumping<br />
* create scripts for JBoss<br />
* Deploy to JBoss<br />
<br />
=== Phase 8: Code Review 1 - Meeting (DONE) ===<br />
* Date: Apr 20,2011 <br />
* Meet with NexJ Developer to review code<br />
<br />
=== Phase 9: Code Review 1 - Apply Changes (DONE) ===<br />
* Estimated Duration: Apr 20, 2011 - July 1, 2011<br />
* [[PostgreSQL_Adapter_Project_-_Code_Review_1_Changes | Changes to be made]]<br />
<br />
=== Phase 10: Code Review 2 (DONE) ===<br />
* Send code for review<br />
*<br />
<br />
=== Phase 11: Code Review 2 - Apply Changes (DONE) ===<br />
* Estimated Duration: July 7, 2011 - July 15, 2011<br />
* [[PostgreSQL_Adapter_Project_-_Code_Review_2_Changes | Changes to be made]]<br />
<br />
=== Phase 12: Code Review 3 (DONE) ===<br />
* Sent code for code review 3<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/08cdedb9d071/<br />
<br />
=== Phase 13: Code Review 3 - Apply Changes (DONE) ===<br />
* Upgrade to lastest 7.1 branch<br />
* Create Statement and PreparedStatementProxy<br />
* Create PostgreSQLPreparedStatementProxy:<br />
** implement set/getQueryTimeout<br />
** move custom timeout code into this proxy<br />
* Override prepareStatement in PostgreSQL to return PostgreSQLPreparedStatementProxy<br />
* Implement implicit save points for statements within a transaction block<br />
* Modify readSchema to use addColumn for reading columns from the database<br />
** Remove MSSQL and Oracle specific code from addColumn<br />
** Override addColumn in PostgreSQL for text, bytea and lo types<br />
<br />
=== Phase 14: Integration Tests (DONE) ===<br />
* Run Integration tests against the Adapter<br />
<br />
=== Phase 15: Code Review 4 (DONE)===<br />
* Code review with framework architect<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/6c9a7380c8fe<br />
<br />
=== Phase 16: Code Review 4 - Apply Changes (DONE) ===<br />
* Estimated Duration: Sep 9 - Sep 12<br />
* [[PostgreSQL_Adapter_Project_-_Code_Review_4_Changes | Changes to be made]]<br />
<br />
=== Phase 17: Code Review 5 (DONE) ===<br />
* Submitted code for review on Sep 20.<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/a0d10ef7cdbe/<br />
<br />
=== Phase 18: Code Review 5 - Apply Changes (DONE) ===<br />
<br />
=== Phase 19: Code Review 6 ===<br />
* Date: Oct 13<br />
* Submitted for code review<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/153aec847d54/<br />
<br />
<br />
<br />
== Project Repository ==<br />
* URL for central repository of the project is: https://bitbucket.org/gbatumbya/nexjexpress-postgresqladapter<br />
<br />
* Steps to work with the repository<br />
<br />
:1- Follow the [https://www.projects.openhealthtools.org/sf/docman/do/downloadDocument/projects.oht_aip/docman.root.nexj_studio_express_v7_1_113_0/doc1783/1 instructions to create the NexJ Express workspace ].<br />
:2- After creating 'ws' directory,<br />
::open Eclipse and<br />
::click on '''File -> Import -> Mercurial -> Clone Existing Mercurial Repository'''<br />
:: Enter this information:<br />
::: '''URL''': https://bitbucket.org/gbatumbya/nexjexpress-postgresqladapter<br />
<!--<br />
:3- The central repository's structure is:<br />
:: Main branch called 'default' <br />
:: Branches for<br />
:4- After cloning the project, follow these steps to add a new branch with your user name:<br />
:: First make sure the active branch is 'default'. Notice the top of the Package Explorer e.g. ''core[5:b8b2f102343@'''default'''(tip)]''<br />
:: Right click on 'core' in the Package Explorer<br />
:: Click on 'Team' -> Add Branch<br />
:: Enter the branch name in the box -> Finish<br />
:: Enter the commit message -> OK<br />
:: Check the 'Force Push' if applicable.<br />
:: Now the branch name at the top of Package Explorer is changed to the new branch name. <br />
: 5- To switch to a different branch, choose 'Switch' instead of 'Add Branch'<br />
<br />
* '''NOTE!''' To avoid any conflict, do the 'Pull' every day and before any push.<br />
* '''NOTE!''' First just 'Commit' changesets and do not 'Push' them until the end of the day or the time you are confident by latest changes to the code, then 'Push' them all at once and 'Merge' them with the 'default' branch in central repository.<br />
--><br />
<br />
== Resources ==<br />
* Downloads<br />
Linux binaries http://www.openscg.org/se/postgresql/packages.jsp<br />
* Debugging<br />
:[[Run_Junit_Tests_For_Non_Default_SQL_Adapter | Unit Testing for non Default SQL Adapter]]<br />
:<br />
* Intro<br />
:Concept of Adapter [http://www.vogella.de/articles/DesignPatternAdapter/article.html]<br />
:FOSSLC [http://www.fosslc.org/drupal/category/community/databases/postgresql PostgreSQL]<br />
* [[PostgreSQL_Adapter-nexj/Resources#Java | Java ]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#Database_.26_Persistence | Database & Persistence]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#JDBC | JDBC]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#PostgreSQL Specifications | PostgreSQL Specifications]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#MySQL_Specifications | MySQL Specifications]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#PostgreSQL_-_MySQL_Compare | Postgre - MySQL Compare]]<br />
<br />
<br />
== Summary of Applied Research ==<br />
* [[Research Findings - PostgreSQLAdapter]]<br />
* [[Research Notes - PostgreSQLAdapter]]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=81549SQLite Adapter StandUp Reports2012-02-16T21:05:18Z<p>Gbatumbya: /* Week 6: Feb 13 */</p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
=Week 9: Mar 5=<br />
=Week 8: Feb 27=<br />
=Week 7: Feb 20=<br />
--><br />
<br />
=Week 6: Feb 13=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
*Building SQLite with ICU statically linked on Windows<br />
*Allow user to set locale for database and or column <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* n/a<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* n/a<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter&diff=81548SQLite Adapter2012-02-16T20:23:47Z<p>Gbatumbya: /* Supported Versions */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express SQLite]]<br />
<br />
<big><big> SQLite Adapter for NexJ </big></big><br />
<br />
<br />
== Project Goal ==<br />
Develop an adapter to enable NexJ Express's model interaction with SQLite databases.<br />
<!--<br />
=== Software Design Document ===<br />
[https://docs.google.com/document/d/1aX9YqdXcABKmxegTcovyZXqWYp_9NnPmke6QU8jfiBU/edit?hl=en_US Read only]<br />
--><br />
<br />
<br />
=== Contributors ===<br />
* [[User:Cwdesautels|Carl Desautels]]<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Abhishekbh|Abhishek Bhatnagar]]<br />
<br />
<br />
=== Supported Versions ===<br />
* sqlite.3.7.10 <br />
** Compiled with the following flags:<br />
***SQLITE_ENABLE_LOAD_EXTENSION=1<br />
***SQLITE_ENABLE_UPDATE_DELETE_LIMIT<br />
***SQLITE_ENABLE_COLUMN_METADATA<br />
***SQLITE_CORE<br />
***SQLITE_ENABLE_FTS4<br />
***SQLITE_ENABLE_FTS3_PARENTHESIS<br />
***SQLITE_ENABLE_RTREE<br />
***SQLITE_ENABLE_STAT3<br />
***SQLITE_SOUNDEX=1<br />
***SQLITE_MAX_VARIABLE_NUMBER=4000<br />
***SQLITE_USE_URI<br />
***SQLITE_ENABLE_ICU<br />
<br />
== Project Status==<br />
* '''Current Sprint''' : [[SQLite_Adapter#Sprint_3 | 3]]<br />
* [[SQLite_Adapter_StandUp_Reports | Stand Up Reports]]<br />
<br />
<br />
== Project Backlog ==<br />
=== Investigation (DONE) ===<br />
* Research SQLite / JDBC driver<br />
* Get requirements from NexJ (Meeting Friday Sept 23rd)<br />
* [[SQLite_Adapter_Research | Research Summary]]<br />
<br />
<br />
=== Sprint: 1 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
|Initial skeleton of the SQLite adapter<br />
|2<br />
|Running the jUnit test shows in the console that the adapter is loaded an running.<br />
|-<br />
|Use database schema tool to generate the SQL to setup the database<br />
|1<br />
|Running the DB Schema Tool's "setup" command, appropriate artifacts are created (e.g. sql or bat script) for generating the SQLite database.<br />
|-<br />
|Use database schema tool to generate the SQL to create the Core datasource's tables<br />
|5<br />
|Running the DB Schema Tool's "create" command, appropriate artifacts are created (e.g. a sql file) for creating the tables in an existing SQLite database.<br />
|}<br />
<br />
<br />
=== Sprint 2 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Use data schema tool to generate the SQL to insert the data from a dump file<br />
| 0<br />
| Running the DB schema Tool's 'insert' command, appropriate artifacts are created in the database<br />
|-<br />
| Use the scheme console to insert into and read from the database<br />
| 0<br />
| Running the schema console, perform multi-transactional inserts with commits and rollbacks. Reading from the database to confirm updates<br />
|-<br />
| Use the data load tool to extract information in a SQLite database and persist it to a dump file<br />
| 0<br />
| Running the data load tool, read information from the database and export it to a dump file<br />
|-<br />
| Use the database schema tool to create an insert script for all the instances in in a SQLite database<br />
| 0<br />
| Running the data load tool, read in information from a dump file<br />
|-<br />
| Add an attribute to the User class, add the column to the datasource and Main.upgrade. Use the data load tool to upgrade the SQLite database. The database now has the new column add to the User Table<br />
| 3<br />
| Running the database schema tool alter the user class and perform an upgrade<br />
|-<br />
| Run each of the data load tool commands to validate their use<br />
| 5<br />
| Running all of the data load tool's commands, checking for expected results<br />
|-<br />
| Run each of the database schema tool commands to validate their use<br />
| 5<br />
| Running all of the database schema tools commands, checking for expected results<br />
|}<br />
<br />
<br />
=== Sprint 3 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Retrieve a record using fulltext search in the where clause<br />
| 0<br />
| Using the SQlite Adapter perform a query to verify the full test search options have been configured properly<br />
|-<br />
| Demonstrate unicode support in sqlite functions<br />
| 5<br />
| Using the SQlite Adapter perform a query to verify unicode support is as expected in sqlite functions<br />
|-<br />
| Run all SQLiteSchemaManager unit tests, to validate correctness<br />
| 2<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|-<br />
| Run all the SQLiteAdapter unit tests, to validate correctness<br />
| 7<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|}<br />
<br />
<br />
== Project Repository ==<br />
* Central: https://bitbucket.org/cwdesautels/nexj-express-sqlite-adapter<br />
<br />
<br />
== Building JDBC from source ==<br />
* [[SQLite_Xerial_JDBC_From_Source | HowTo]] <br />
<br />
<br />
== Resources ==<br />
* Dowloads:<br />
** http://www.sqlite.org/download.html<br />
* Documentation:<br />
** Root - http://www.sqlite.org/docs.html<br />
** About - http://www.sqlite.org/about.html<br />
** Types - http://www.sqlite.org/datatype3.html<br />
** Limits - http://www.sqlite.org/limits.html<br />
** Null Handling - http://www.sqlite.org/nulls.html<br />
** Omitted Features - http://www.sqlite.org/omitted.html<br />
** SQL to SQLite - http://www.sqlite.org/lang_expr.html<br />
** API - http://www.sqlite.org/c3ref/intro.html<br />
* QuickStart:<br />
** Usage - http://www.sqlite.org/cintro.html<br />
** C Interface - http://www.sqlite.org/cintro.html<br />
* SQLite JDBC Driver:<br />
** (Unoffical) http://www.xerial.org/trac/Xerial</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter&diff=81547SQLite Adapter2012-02-16T20:23:23Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express SQLite]]<br />
<br />
<big><big> SQLite Adapter for NexJ </big></big><br />
<br />
<br />
== Project Goal ==<br />
Develop an adapter to enable NexJ Express's model interaction with SQLite databases.<br />
<!--<br />
=== Software Design Document ===<br />
[https://docs.google.com/document/d/1aX9YqdXcABKmxegTcovyZXqWYp_9NnPmke6QU8jfiBU/edit?hl=en_US Read only]<br />
--><br />
<br />
<br />
=== Contributors ===<br />
* [[User:Cwdesautels|Carl Desautels]]<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Abhishekbh|Abhishek Bhatnagar]]<br />
<br />
<br />
=== Supported Versions ===<br />
* sqlite.3.7.10 <br />
** Complited with the following flags:<br />
***SQLITE_ENABLE_LOAD_EXTENSION=1<br />
***SQLITE_ENABLE_UPDATE_DELETE_LIMIT<br />
***SQLITE_ENABLE_COLUMN_METADATA<br />
***SQLITE_CORE<br />
***SQLITE_ENABLE_FTS4<br />
***SQLITE_ENABLE_FTS3_PARENTHESIS<br />
***SQLITE_ENABLE_RTREE<br />
***SQLITE_ENABLE_STAT3<br />
***SQLITE_SOUNDEX=1<br />
***SQLITE_MAX_VARIABLE_NUMBER=4000<br />
***SQLITE_USE_URI<br />
***SQLITE_ENABLE_ICU<br />
<br />
<br />
== Project Status==<br />
* '''Current Sprint''' : [[SQLite_Adapter#Sprint_3 | 3]]<br />
* [[SQLite_Adapter_StandUp_Reports | Stand Up Reports]]<br />
<br />
<br />
== Project Backlog ==<br />
=== Investigation (DONE) ===<br />
* Research SQLite / JDBC driver<br />
* Get requirements from NexJ (Meeting Friday Sept 23rd)<br />
* [[SQLite_Adapter_Research | Research Summary]]<br />
<br />
<br />
=== Sprint: 1 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
|Initial skeleton of the SQLite adapter<br />
|2<br />
|Running the jUnit test shows in the console that the adapter is loaded an running.<br />
|-<br />
|Use database schema tool to generate the SQL to setup the database<br />
|1<br />
|Running the DB Schema Tool's "setup" command, appropriate artifacts are created (e.g. sql or bat script) for generating the SQLite database.<br />
|-<br />
|Use database schema tool to generate the SQL to create the Core datasource's tables<br />
|5<br />
|Running the DB Schema Tool's "create" command, appropriate artifacts are created (e.g. a sql file) for creating the tables in an existing SQLite database.<br />
|}<br />
<br />
<br />
=== Sprint 2 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Use data schema tool to generate the SQL to insert the data from a dump file<br />
| 0<br />
| Running the DB schema Tool's 'insert' command, appropriate artifacts are created in the database<br />
|-<br />
| Use the scheme console to insert into and read from the database<br />
| 0<br />
| Running the schema console, perform multi-transactional inserts with commits and rollbacks. Reading from the database to confirm updates<br />
|-<br />
| Use the data load tool to extract information in a SQLite database and persist it to a dump file<br />
| 0<br />
| Running the data load tool, read information from the database and export it to a dump file<br />
|-<br />
| Use the database schema tool to create an insert script for all the instances in in a SQLite database<br />
| 0<br />
| Running the data load tool, read in information from a dump file<br />
|-<br />
| Add an attribute to the User class, add the column to the datasource and Main.upgrade. Use the data load tool to upgrade the SQLite database. The database now has the new column add to the User Table<br />
| 3<br />
| Running the database schema tool alter the user class and perform an upgrade<br />
|-<br />
| Run each of the data load tool commands to validate their use<br />
| 5<br />
| Running all of the data load tool's commands, checking for expected results<br />
|-<br />
| Run each of the database schema tool commands to validate their use<br />
| 5<br />
| Running all of the database schema tools commands, checking for expected results<br />
|}<br />
<br />
<br />
=== Sprint 3 ===<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! User Story<br />
! Score<br />
! Details<br />
|-<br />
| Retrieve a record using fulltext search in the where clause<br />
| 0<br />
| Using the SQlite Adapter perform a query to verify the full test search options have been configured properly<br />
|-<br />
| Demonstrate unicode support in sqlite functions<br />
| 5<br />
| Using the SQlite Adapter perform a query to verify unicode support is as expected in sqlite functions<br />
|-<br />
| Run all SQLiteSchemaManager unit tests, to validate correctness<br />
| 2<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|-<br />
| Run all the SQLiteAdapter unit tests, to validate correctness<br />
| 7<br />
| Using studio perform all the tests as Junit tests, ensuring no failures.<br />
|}<br />
<br />
<br />
== Project Repository ==<br />
* Central: https://bitbucket.org/cwdesautels/nexj-express-sqlite-adapter<br />
<br />
<br />
== Building JDBC from source ==<br />
* [[SQLite_Xerial_JDBC_From_Source | HowTo]] <br />
<br />
<br />
== Resources ==<br />
* Dowloads:<br />
** http://www.sqlite.org/download.html<br />
* Documentation:<br />
** Root - http://www.sqlite.org/docs.html<br />
** About - http://www.sqlite.org/about.html<br />
** Types - http://www.sqlite.org/datatype3.html<br />
** Limits - http://www.sqlite.org/limits.html<br />
** Null Handling - http://www.sqlite.org/nulls.html<br />
** Omitted Features - http://www.sqlite.org/omitted.html<br />
** SQL to SQLite - http://www.sqlite.org/lang_expr.html<br />
** API - http://www.sqlite.org/c3ref/intro.html<br />
* QuickStart:<br />
** Usage - http://www.sqlite.org/cintro.html<br />
** C Interface - http://www.sqlite.org/cintro.html<br />
* SQLite JDBC Driver:<br />
** (Unoffical) http://www.xerial.org/trac/Xerial</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=GAM670/DPS905_Weekly_Schedule_20121&diff=81435GAM670/DPS905 Weekly Schedule 201212012-02-15T14:31:58Z<p>Gbatumbya: /* This Week */</p>
<hr />
<div>{{GAM670/DPS905 Index | 20121}}<br />
= GAM670/DPS905 -- Weekly Schedule 20121=<br />
<br />
== Week 1 - Jan 8 ==<br />
<br />
=== This Week ===<br />
* Assignment Discussion<br />
* Suggested Enhancements<br />
* Review of the Base Code<br />
** Definition of a Framework<br />
*** Modularity through stable interfaces<br />
*** Re-usability through generic components<br />
*** Extensibility through hook methods<br />
*** Inversion of control - determines which application methods to invoke in response to external events<br />
** Framework Architecture<br />
*** Modelling Layer<br />
*** API Translation Layer<br />
** Notable Features of the Base Code<br />
** camera, sound, and light are also derived from the Frame class<br />
** textures attach at the object level<br />
** texture connection is uncoupled from drawing of the graphics primitives<br />
** reference frames are relative<br />
** very simple collision detection<br />
<br />
=== To Do ===<br />
<br />
# add your name to the student list<br />
# create a team page that includes the semester number 20121<br />
#* describe the game that you intend to develop<br />
#* list the topics of interest to your team in developing its game<br />
#* list the other topics of interest<br />
<!--<br />
# Port Game Design over to Update Base Code--><br />
<br />
=== Resources ===<br />
<br />
<br />
== Week 2 - Jan 16 ==<br />
<br />
=== This Week ===<br />
<br />
* Relative Reference Frames<br />
** Recursive calls<br />
**: Vector Frame::position()<br />
**: Matrix Frame::rotation()<br />
**: Matrix Frame::world()<br />
** Detaching from and attaching to a parent frame<br />
**: Frame::attachTo()<br />
* Geometry<br />
** Plane<br />
**: normal + constant - examples<br />
**: equation of a plane: dot(n, x) + D = 0<br />
**: positive side of a plane dot(n, x) + D > 0<br />
* Collision Detection<br />
*: types of colliders<br />
*:: spheres<br />
*:: planes<br />
*:: axis-aligned bounding boxes<br />
*:: oriented bounding boxes<br />
<br />
=== To Do ===<br />
* Research the feature that you are going to add and prepare a plan of action<br />
* Prepare a team page for your team so that repos can be ordered<br />
* Add a section to your team page to track your project and solicit commentary<br />
<br />
=== Resources ===<br />
<br />
== Week 3 - Jan 23 ==<br />
=== This Week ===<br />
* Collision Detection (cont'd)<br />
*: Shape<br />
*:: Shape : Frame<br />
*:: Shape::setRadius()<br />
*:: Shape::getRadius()<br />
*:: Shape::setRadius(float r);<br />
*:: Shape::setRadius(float x, float y, float z);<br />
*:: Shape::getRadius() const { return radius; }<br />
*:: Shape::setPlane(Vector n, float d);<br />
*:: Shape::setAxisAligned(Vector min, Vector max);<br />
* Comprehensive Camerawork<br />
*: rotation about an axis<br />
*: order of rotation matters<br />
*: Euler angles<br />
*:: [http://www.youtube.com/watch?v=UpSMNYTVqQI&feature=related 3-2-1 angles]<br />
*: gimbal lock<br />
*:: [http://www.youtube.com/watch?v=rrUCBOlJdt4&feature=related StephenSeefeld.net]<br />
*: complex numbers<br />
*:: solution of cubic equations 16th century<br />
*:: two-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers matrix representation]<br />
*: quaternions<br />
*:: extension of complex numbers<br />
*:: four-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Quaternion#Matrix_representations matrix representation]<br />
*: geometric algebra (more abstract)<br />
*:: [http://staff.science.uva.nl/~leo/cinderella/line1.html Dorst's site]<br />
*:: [http://sinai.apphy.u-fukui.ac.jp/gcj/software/GAcindy-1.4/GAcindy.htm Hitzer's site]<br />
* Visibility Determination<br />
**: test a point for presence within a set of planes<br />
**: normal calculations - general rotation matrix - vector and angle<br />
** ViewFrustum<br />
**: parameter - view * projection<br />
**: 6 planes<br />
**:: near and far planes<br />
**:: left and right planes<br />
**:: top and bottom planes<br />
**: coding<br />
**:: constructor<br />
**:: ViewFrustum::contains()<br />
** Finite Size of Objects<br />
**: Expansion of the View Frustum<br />
* Index Buffers<br />
*: amount of storage needed for vertex data<br />
*: duplication of vertex data<br />
*: indexing<br />
*: indexed primitives<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://en.wikipedia.org/wiki/Complex_number Wikipedia on Complex Numbers]<br />
* [http://en.wikipedia.org/wiki/Quaternion Wikipedia on Quaternions]<br />
* [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Wikipedia on quaternions and Spatial Rotations]<br />
* [http://mathworld.wolfram.com/Quaternion.html Wolfram on Quaternions]<br />
* [http://www.cprogramming.com/tutorial/3d/quaternions.html CProgramming.com on Quaternions]<br />
* [http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer Ogre intro on Quaternions]<br />
* collision sample<br />
* indexBuffering sample<br />
<br />
<br />
== Week 4 - Jan 30 ==<br />
=== This Week ===<br />
* Meshes<br />
*: What is a mesh?<br />
*:: vertex list -> vertex buffer<br />
*:: index list -> index buffer<br />
*:: attribute list -> subset to which primitives belong<br />
*:: pyramid sample<br />
*: Stock Objects<br />
*:: Sphere<br />
*::: slices and partitions<br />
*:: Cylinder<br />
*:: Torus<br />
*:: Utah Teapot<br />
*:: APIGraphic.h and .cpp code<br />
*: Custom Mesh<br />
*:: Create a Mesh<br />
*:: FVF settings<br />
*:: DrawSubset<br />
*::: DrawIndexedPrimitive parameters<br />
*:: APIGraphic.h code<br />
*: X File<br />
*:: Create Mesh from File<br />
* SkyBox<br />
*: definition of a skybox<br />
*:: attachment to camera<br />
*:: inverted coordinates<br />
*: skybox textures<br />
*: Graphic.cpp code<br />
*: more complicated forms - skydome<br />
* Billboards<br />
*: definition, purpose of a billboard<br />
*: types of billboards<br />
*:: screen-aligned - useful for annotation text, lens flares<br />
*::: normal is opposite to camera heading<br />
*::: up is camera->up<br />
*:: axial - useful for cylindrical symmetry - trees (textured object does not face straight on)<br />
*::: up is fixed<br />
*::: normal faces the viewer as much as possible<br />
*:: view_plane - no distortion - useful for<br />
*::: normal is fixed (opposite to camera heading)<br />
*::: up is open to change<br />
*:: viewpoint - simulates distortion due to perspective projection - useful for clouds<br />
*::: normal is fixed (difference between viewpoint position and camera heading)<br />
*::: up is open to change<br />
*: Object.h and Object.cpp code<br />
* Texture Filtering<br />
*: mip maps<br />
*:: multum in parvo<br />
*:: texture creation<br />
*:: APITexture::SetSamplerState()<br />
* DirectX Errors<br />
*: DirectX Utilities - Lookup Tool<br />
*: APIDisplay::restore() example<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* meshes sample<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 Rob Whitaker on Skyboxes]<br />
* [http://web.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/suman_wk8_IBR.pdf Image Based Rendering - Suman Nadella on Billboarding and Imposters]<br />
* [http://www.digitalrune.com/Products/GameEngine/Particles.aspx DigitalRune]<br />
* [http://en.wikipedia.org/wiki/Mipmap Wikipedia on Texture Filtering]<br />
* [http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx D3D 9 tutorial on modeling with an Index list]<br />
<br />
== Week 5 - Feb 6 ==<br />
=== This Week ===<br />
* Vertex Declarations<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172559%28v=vs.85%29.aspx FVF Codes]<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172630%28v=vs.85%29.aspx D3DVERTEXELEMENT9 struct]<br />
* The Pipeline<br />
*: [http://en.wikipedia.org/wiki/Instruction_pipeline What is a pipeline]<br />
*:<br />
* The GPU<br />
*: [http://en.wikipedia.org/wiki/Graphics_processing_unit What is a GPU]<br />
** nVidia<br />
**: [http://en.wikipedia.org/wiki/Geforce GeForce]<br />
**: [http://en.wikipedia.org/wiki/NVIDIA_Quadro Quadro]<br />
**: [http://en.wikipedia.org/wiki/Nvidia_Tesla Tesla]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units Comparison]<br />
** AMD (previously ATI)<br />
**: [http://en.wikipedia.org/wiki/Radeon_R520 Radeon 520]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_AMD_graphics_processing_units Comparison]<br />
* Shader Languages<br />
*: [http://en.wikipedia.org/wiki/Shader what is a shader]<br />
*: dedicated shaders<br />
*: [http://en.wikipedia.org/wiki/Unified_shader_model unified shaders]<br />
*: how does a shader work<br />
** Languages<br />
**: [http://en.wikipedia.org/wiki/HLSL HLSL - Microsoft]<br />
**: [http://en.wikipedia.org/wiki/Cg_%28programming_language%29 Cg - nVidia]<br />
**: [http://en.wikipedia.org/wiki/GLSL GLSL - OpenGL (Khronos)]<br />
* Vertex Shaders<br />
* Pixel Shaders<br />
* effect of skybox and point light on frame rate<br />
<br />
=== To Do ===<br />
<br />
== Week 6 - Feb 13 ==<br />
=== This Week ===<br />
* Vertex Shader Programming<br />
** Host<br />
:: APIPlatformSettings.h - Vertex Shader Identification - select between fixed function and programmable pipelines here<br />
<syntaxhighlight lang="cpp"><br />
// shader file data<br />
#define VERTEX_SHADER_FILE L"vertexShader.hlsl"<br />
#define VERTEX_SHADER_ENTRY_POINT "vertexShader"<br />
</syntaxhighlight><br />
:: APIBase.h - pointers into the shader - APIBase is the base class for the graphics API classes<br />
<syntaxhighlight lang="cpp"><br />
static IDirect3DVertexShader9* vertexShader; // vertex shader<br />
static ID3DXConstantTable* uniformVS; // for vertex shader<br />
</syntaxhighlight><br />
:: APIBase.cpp - initialize the shader pointers<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DVertexShader9* APIBase::vertexShader = nullptr; // vertex shader<br />
ID3DXConstantTable* APIBase::uniformVS = nullptr; // for vertex shader<br />
</syntaxhighlight><br />
:: APIDisplay.h - keeps track of the current projection matrix<br />
<syntaxhighlight lang="cpp"><br />
Matrix projection; // projection transformation<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - setup() - checks the shader version<br />
<syntaxhighlight lang="cpp"><br />
// points to compiled shader code<br />
LPD3DXBUFFER compiledCodeVS = nullptr;<br />
<br />
// check for minimum vertex shader version required<br />
if (caps.VertexShaderVersion < D3DVS_VERSION(2,0))<br />
error(L"APIDisplay::09 Device does not support vertex shader 2_0");<br />
</syntaxhighlight><br />
compiles the shader hlsl code, retrieves address of constant memory and vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// compile the vertex shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(VERTEX_SHADER_FILE, NULL,<br />
NULL, VERTEX_SHADER_ENTRY_POINT, D3DXGetVertexShaderProfile(d3dd),<br />
D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION,<br />
&compiledCodeVS, NULL, &uniformVS))) {<br />
release();<br />
error(L"APIDisplay::13 Unable to compile vertex shader");<br />
}<br />
// create the vertex shader object<br />
else if (FAILED(d3dd->CreateVertexShader(<br />
(DWORD*)compiledCodeVS->GetBufferPointer(), &vertexShader))) {<br />
compiledCodeVS->Release();<br />
release();<br />
error(L"APIDisplay::14 Unable to create vertex shader object");<br />
}<br />
else {<br />
compiledCodeVS->Release();<br />
</syntaxhighlight><br />
sets the current vertex shader<br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetVertexShader(vertexShader);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - setProjection() - stores the projection matrix<br />
<syntaxhighlight lang="cpp"><br />
this->projection = *((Matrix*)projection);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - beginDrawFrame() - copies the view matrix and the camera heading to constant memory<br />
<syntaxhighlight lang="cpp"><br />
Matrix& v = *((Matrix*)view);<br />
Matrix viewProjection = v * projection;<br />
uniformVS->SetMatrix(d3dd, "viewProjection",<br />
(D3DXMATRIX*)&viewProjection);<br />
Vector heading(v.m13, v.m23, v.m33);<br />
// Required for specular lighting calculations<br />
uniformVS->SetFloatArray(d3dd, "heading", (FLOAT*)&heading, 3);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformVS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformVS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - set() - copies the lighting state to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - setWorld() - copies the world matrix to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetMatrix(d3dd, "world", (D3DXMATRIX*)world);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - setReflectivity() - copies the reflectivity to constant memory<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformVS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - release() - releases constant memory and the vertex shader<br />
<syntaxhighlight lang="cpp"><br />
// release the shader COM objects<br />
if (uniformVS) {<br />
uniformVS->Release();<br />
uniformVS = nullptr;<br />
}<br />
if (vertexShader) {<br />
vertexShader->Release();<br />
vertexShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
:: APILight.cpp - setup() - copies the light properties to constant memory<br />
<syntaxhighlight lang="cpp"><br />
// Populate the vertex shader constant table<br />
//<br />
// Light descriptors within the vertex shader<br />
char typ[] = "light[0].type";<br />
char amb[] = "light[0].ambient";<br />
char dif[] = "light[0].diffuse";<br />
char spe[] = "light[0].specular";<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
char spt[] = "light[0].spot";<br />
char att[] = "light[0].attenuation";<br />
char ran[] = "light[0].range";<br />
//<br />
// Reset index in light descriptor<br />
typ[6] = index + '0';<br />
amb[6] = index + '0';<br />
dif[6] = index + '0';<br />
spe[6] = index + '0';<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
spt[6] = index + '0';<br />
att[6] = index + '0';<br />
ran[6] = index + '0';<br />
// Populate the vertex shader constant table<br />
Vector attenuation(attenuation0, attenuation1, attenuation2);<br />
Vector spot(cosf(phi/2), cosf(theta/2), falloff);<br />
Vector zero;<br />
uniformVS->SetInt(d3dd, typ, type);<br />
uniformVS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformVS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformVS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformVS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformVS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformVS->SetFloat(d3dd, ran, range);<br />
rc = true;<br />
</syntaxhighlight><br />
:: APILight.cpp - turnOn() - repositions the light and turns it on<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
:: APILight.cpp - update() - repositions the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
char pos[] = "light[0].position";<br />
char dir[] = "light[0].direction";<br />
pos[6] = index + '0';<br />
dir[6] = index + '0';<br />
uniformVS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformVS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformVS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
:: APILight.cpp - turnOff() - turns off the light<br />
<syntaxhighlight lang="cpp"><br />
char constantLightOn[] = "lightOn[0]";<br />
constantLightOn[8] = index + '0';<br />
uniformVS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
:: APIGraphic.h - class APIXMesh - processes an X file mesh<br />
<syntaxhighlight lang="cpp"><br />
D3DXCOLOR* ambient;<br />
D3DXCOLOR* diffuse;<br />
D3DXCOLOR* specular;<br />
FLOAT* power;<br />
</syntaxhighlight><br />
:: APIGraphic.cpp - APIXMesh() - constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
:: APIGraphic.cpp - APIXMesh() - copy constructor<br />
<syntaxhighlight lang="cpp"><br />
ambient = nullptr;<br />
diffuse = nullptr;<br />
specular = nullptr;<br />
power = nullptr;<br />
</syntaxhighlight><br />
:: APIGraphic.cpp - operator=() = assignment operator<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
ambient = new D3DXCOLOR[src.nSubsets];<br />
diffuse = new D3DXCOLOR[src.nSubsets];<br />
specular = new D3DXCOLOR[src.nSubsets];<br />
power = new FLOAT[src.nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
for (unsigned i = 0; i < nSubsets; i++) {<br />
ambient[i] = src.ambient[i];<br />
diffuse[i] = src.diffuse[i];<br />
specular[i] = src.specular[i];<br />
power[i] = src.power[i];<br />
}<br />
</syntaxhighlight><br />
:: APIGraphic.cpp - setup() -<br />
<syntaxhighlight lang="cpp"><br />
ambient = new D3DXCOLOR[nSubsets];<br />
diffuse = new D3DXCOLOR[nSubsets];<br />
specular = new D3DXCOLOR[nSubsets];<br />
power = new FLOAT[nSubsets];<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
ambient[i].r = matl[i].MatD3D.Diffuse.r * 0.7f;<br />
ambient[i].g = matl[i].MatD3D.Diffuse.g * 0.7f;<br />
ambient[i].b = matl[i].MatD3D.Diffuse.b * 0.7f;<br />
ambient[i].a = matl[i].MatD3D.Diffuse.a;<br />
diffuse[i] = matl[i].MatD3D.Diffuse; // reflected from lights<br />
specular[i] = matl[i].MatD3D.Specular; // shine from lights<br />
power[i] = matl[i].MatD3D.Power; // 0 if it shouldn't be shiny<br />
</syntaxhighlight><br />
:: APIGraphic.cpp - draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformVS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformVS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformVS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
:: APIGraphic.cpp - suspend()<br />
<syntaxhighlight lang="cpp"><br />
if (ambient)<br />
delete [] ambient;<br />
if (diffuse)<br />
delete [] diffuse;<br />
if (specular)<br />
delete [] specular;<br />
if (power)<br />
delete [] power;<br />
</syntaxhighlight><br />
** Device<br />
:: vertexShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawVertex holds the untransformed data for a single vertex<br />
//<br />
struct RawVertex {<br />
<br />
float3 position : POSITION; // position in local space<br />
float3 normal : NORMAL; // normal in local space<br />
float2 texCoord : TEXCOORD; // texture coordinates<br />
};<br />
<br />
// TransformedVertex holds the transformed data for a single vertex<br />
//<br />
struct TransformedVertex {<br />
<br />
float4 position : POSITION; // position in homogeneous clip space<br />
float4 colour : COLOR; // colour of the lit vertex<br />
float2 texCoord0 : TEXCOORD0; // texture coordinates - stage 0<br />
float2 texCoord1 : TEXCOORD1; // texture coordinates - stage 1<br />
};<br />
<br />
// Uniform Data (constant for a stream of vertices)<br />
//<br />
// Lighting<br />
float4 ambient; // global ambient light - always on<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // switches for static lights<br />
Material material; // material reflectivity<br />
// Geometry<br />
float4x4 viewProjection; // view * projection transformation<br />
float4x4 world; // world transformation<br />
float3 heading; // camera heading for specular calcs<br />
// Lit Vertex<br />
bool litVertex; // omit lighting calculations - already lit<br />
<br />
</syntaxhighlight><br />
:: vertexShader.hlsl - vertexShader()<br />
<syntaxhighlight lang="cpp"><br />
// vertexShader receives a raw vertex and returns the transformed vertex<br />
//<br />
TransformedVertex vertexShader(RawVertex raw) {<br />
<br />
TransformedVertex transformed;<br />
float4 worldPosition; // world position of the vertex<br />
float3 worldNormal; // vertex normal in world space<br />
<br />
// Transform the vertex to homogeneous clip coordinates<br />
//<br />
// A more efficient algorithm would accept the world*view*projection<br />
// tranformation as one uniform matrix and avoid the 2-stage product<br />
// This will require a bit of restructuring of the application code.<br />
//<br />
worldPosition = mul(float4(raw.position, 1.0), world); // local to world<br />
transformed.position = mul(worldPosition, viewProjection); //... to clip<br />
<br />
// not working<br />
if (litVertex) {<br />
transformed.colour.r = raw.normal.r;<br />
transformed.colour.g = raw.normal.g;<br />
transformed.colour.b = raw.normal.b;<br />
transformed.colour.a = 1.0f;<br />
}<br />
else {<br />
<br />
// Transform the vertex normal to world space. Only the rotation-scaling<br />
// part of the world transformation is used. Since the world<br />
// transformation may contain scaling, the result of this multiplication<br />
// needs to be normalized.<br />
//<br />
worldNormal = mul(raw.normal, (float3x3)world);<br />
worldNormal = normalize(worldNormal);<br />
<br />
// Determine the colour of the vertex from each light in turn<br />
//<br />
// Use the cosine of the angle between the worldNormal and the direction<br />
// of the light to determine the amount of reflected light. The cosine<br />
// is given by the dot product, if both vectors have been normalized. If<br />
// the cosine is less than 0, the angle is greater than 90 degrees and<br />
// no light is reflected. Use saturate() to implement this condition.<br />
//<br />
// A more efficient algorithm would supply the light direction already<br />
// converted to the local space of the vertex (by using the inverse of<br />
// the world transformation).<br />
//<br />
<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
float3 lightDirection, camera = normalize(heading);<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
<br />
for (int i = 0; i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
lightDirection = - normalize((light[i].type == POINT_LIGHT)?<br />
float3(worldPosition.x, worldPosition.y, worldPosition.z) -<br />
light[i].position : light[i].direction);<br />
diffuseFactor = saturate(dot(worldNormal, lightDirection));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
worldNormal - lightDirection), camera));<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length((float3)worldPosition - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(worldPosition.x, worldPosition.y,<br />
worldPosition.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(<br />
abs((rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit vertex<br />
//<br />
transformed.colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
<br />
// pass the diffuse alpha along as the alpha component<br />
//<br />
transformed.colour.w = material.diffuse.w;<br />
}<br />
<br />
// pass the texture coordinates along unaltered<br />
//<br />
transformed.texCoord0 = raw.texCoord;<br />
transformed.texCoord1 = raw.texCoord;<br />
<br />
return transformed;<br />
}<br />
</syntaxhighlight><br />
* Fragment Shader<br />
:* Host<br />
:: APIPlatformSettings.h<br />
<syntaxhighlight lang="cpp"><br />
#define FRAGMENT_SHADER_FILE L"fragmentShader.hlsl"<br />
#define FRAGMENT_SHADER_ENTRY_POINT "fragmentShader"<br />
</syntaxhighlight><br />
:: APIBase.h<br />
<syntaxhighlight lang="cpp"><br />
// Fragment Shader Support<br />
static IDirect3DPixelShader9* fragmentShader; // fragment shader<br />
static ID3DXConstantTable* uniformFS; // for fragment shader<br />
</syntaxhighlight><br />
:: APIBase.cpp<br />
<syntaxhighlight lang="cpp"><br />
IDirect3DPixelShader9* APIBase::fragmentShader = nullptr; // fragment shader<br />
ID3DXConstantTable* APIBase::uniformFS = nullptr; // for fragment shader<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
LPD3DXBUFFER compiledCodeFS = nullptr;<br />
<br />
// checks for minimum pixel shader version required<br />
else if (caps.PixelShaderVersion < D3DPS_VERSION(3,0))<br />
error(L"Display::10 Device does not support pixel shader 3_0");<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
// compile the fragment shader source code<br />
else if (FAILED(D3DXCompileShaderFromFile(FRAGMENT_SHADER_FILE, NULL,<br />
NULL, FRAGMENT_SHADER_ENTRY_POINT, D3DXGetPixelShaderProfile(d3dd), 0,<br />
&compiledCodeFS, NULL, &uniformFS))) {<br />
release();<br />
error(L"APIDisplay::15 Unable to compile the fragment shader code");<br />
}<br />
// create the pixel shader object<br />
else if (FAILED(d3dd->CreatePixelShader(<br />
(DWORD*)compiledCodeFS->GetBufferPointer(), &fragmentShader))) {<br />
compiledCodeFS->Release();<br />
release();<br />
error(L"APIDisplay::16 Unable to create fragment shader object");<br />
}<br />
else {<br />
compiledCodeFS->Release();<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
d3dd->SetPixelShader(fragmentShader);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - beginDrawFrame()<br />
<syntaxhighlight lang="cpp"><br />
Colour colour(red, green, blue);<br />
uniformFS->SetFloatArray(d3dd, "ambient", (FLOAT*)&colour, 4);<br />
uniformFS->SetInt(d3dd, "noLights", 4);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - set()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, "lighting", b);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - setReflectivity()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&r.ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&r.diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&r.specular, 4);<br />
uniformFS->SetFloat (d3dd, "material.power", (FLOAT)r.power);<br />
</syntaxhighlight><br />
:: APIDisplay.cpp - release()<br />
<syntaxhighlight lang="cpp"><br />
}<br />
if (uniformFS) {<br />
uniformFS->Release();<br />
uniformFS = nullptr;<br />
}<br />
if (fragmentShader) {<br />
fragmentShader->Release();<br />
fragmentShader = nullptr;<br />
}<br />
</syntaxhighlight><br />
:: APIGraphic.cpp - APIXMesh::draw()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, "material.ambient", (FLOAT*)&ambient[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.diffuse", (FLOAT*)&diffuse[i], 4);<br />
uniformFS->SetFloatArray(d3dd, "material.specular", (FLOAT*)&specular[i], 4);<br />
uniformFS->SetFloat(d3dd, "material.power", (FLOAT)power[i]);<br />
</syntaxhighlight><br />
:: APILight.cpp - setup()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetInt(d3dd, typ, type);<br />
uniformFS->SetFloatArray(d3dd, amb, (FLOAT*)&ambient, 4);<br />
uniformFS->SetFloatArray(d3dd, dif, (FLOAT*)&diffuse, 4);<br />
uniformFS->SetFloatArray(d3dd, spe, (FLOAT*)&specular, 4);<br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&zero, 3);<br />
uniformFS->SetFloatArray(d3dd, att, (FLOAT*)&attenuation, 3);<br />
uniformFS->SetFloatArray(d3dd, spt, (FLOAT*)&spot, 3);<br />
uniformFS->SetFloat(d3dd, ran, range);<br />
</syntaxhighlight><br />
:: APILight.cpp - turnOn()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
:: APILight.cpp - update()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetFloatArray(d3dd, pos, (FLOAT*)&p, 3);<br />
uniformFS->SetFloatArray(d3dd, dir, (FLOAT*)&o, 3);<br />
uniformFS->SetBool(d3dd, constantLightOn, true);<br />
</syntaxhighlight><br />
:: APILight.cpp - turnOff()<br />
<syntaxhighlight lang="cpp"><br />
uniformFS->SetBool(d3dd, constantLightOn, false);<br />
</syntaxhighlight><br />
:: APITexture.cpp - attach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, true);<br />
</syntaxhighlight><br />
:: APITexture.cpp - detach()<br />
<syntaxhighlight lang="cpp"><br />
char str[] = "texOn";<br />
uniformFS->SetBool(d3dd, str, false);<br />
</syntaxhighlight><br />
** Device<br />
:: fragmentShader.hlsl - Constant Memory<br />
<syntaxhighlight lang="cpp"><br />
#define MLIGHTS 4<br />
#define MTEXTURES 2<br />
#define POINT_LIGHT 0<br />
#define SPOT_LIGHT 1<br />
#define DIRECTIONAL_LIGHT 2<br />
<br />
// Types<br />
//<br />
// Light holds the data for a single static light in world space<br />
//<br />
struct Light {<br />
int type; // POINT_LIGHT, SPOT_LIGHT, DIRECTIONAL_LIGHT<br />
float4 ambient; <br />
float4 diffuse;<br />
float4 specular;<br />
float3 direction; // in world space<br />
float3 position; // in world space<br />
float3 attenuation; // .xyz for 1.0f/ (.x + .y * d + .z * d * d)<br />
float3 spot; // .x = cos(phi/2), .y = cos(theta/2), .z = falloff<br />
float range; // where attenuation becomes 0<br />
};<br />
<br />
// Material holds the reflectivity properties of the material<br />
//<br />
struct Material {<br />
float4 ambient;<br />
float4 diffuse;<br />
float4 specular;<br />
float power;<br />
};<br />
<br />
// RawPixel holds the data for a single fragment of the stream<br />
//<br />
struct RawPixel {<br />
float2 texcoord : TEXCOORD0; // texture coordinate at this fragment<br />
float3 position : TEXCOORD1; // fragment position in world space<br />
float3 normal : TEXCOORD2; // lighting normal in world space<br />
float3 toViewer : TEXCOORD3; // direction to viewer in world space<br />
};<br />
<br />
// Uniform Data (constant for a stream of fragments)<br />
//<br />
float4 ambient; // global ambient light - always on<br />
int noLights; // no of active lights<br />
Light light[MLIGHTS]; // static lights<br />
bool lightOn[MLIGHTS]; // light switch<br />
Material material; // material reflectivity<br />
bool lighting; // lighting calculations on?<br />
<br />
bool texOn; // texture switch<br />
sampler2D tex; // set by the application<br />
<br />
</syntaxhighlight><br />
:: fragmentShader.hlsl - fragmentShader()<br />
<syntaxhighlight lang="cpp"><br />
// The fragment shader receives raw fragment data and returns a pixel colour<br />
//<br />
float4 fragmentShader(RawPixel raw) : COLOR {<br />
<br />
float4 colour; // result returned by this function<br />
float3 normal; // normal to the fragment<br />
float3 toViewer; // from fragment to the camera<br />
float3 toLightSource; // from fragment to current light source<br />
<br />
// lighting contribution accumulators<br />
float3 ambientLight = ambient.xyz;<br />
float3 diffuseLight = (float3)0;<br />
float3 specularLight = (float3)0;<br />
// lighting calculation factors<br />
float diffuseFactor, reflectFactor, distance;<br />
float attenuationFactor, spotFactor, rho;<br />
<br />
// normalize the fragment data<br />
normal = normalize(raw.normal);<br />
toViewer = normalize(raw.toViewer);<br />
<br />
// perform calculations for each light in turn<br />
for (int i = 0; i < noLights && i < MLIGHTS; i++) {<br />
if (lightOn[i]) {<br />
float diffuseFactor, reflectFactor, factor;<br />
// diffuse and reflection factors<br />
toLightSource = normalize((light[i].type == POINT_LIGHT)?<br />
light[i].position - raw.position : - light[i].direction);<br />
diffuseFactor = saturate(dot(normal, toLightSource));<br />
reflectFactor = saturate(dot(normalize(2 * diffuseFactor *<br />
normal - toLightSource), toViewer));<br />
<br />
attenuationFactor = 1.0f;<br />
spotFactor = 1.0f;<br />
<br />
if (light[i].type == POINT_LIGHT ||<br />
light[i].type == SPOT_LIGHT) {<br />
// detail calcs for attenuationFactor and spotFactor<br />
distance = length(raw.position - light[i].position);<br />
if (distance < light[i].range) {<br />
attenuationFactor = light[i].attenuation.x +<br />
light[i].attenuation.y * distance +<br />
light[i].attenuation.z * distance * distance;<br />
attenuationFactor = 1.0f / attenuationFactor;<br />
if (light[i].type == SPOT_LIGHT) {<br />
rho = saturate(dot(normalize(light[i].position -<br />
float3(raw.position.x, raw.position.y,<br />
raw.position.z)),<br />
normalize(-light[i].direction)));<br />
if (rho <= light[i].spot.x)<br />
spotFactor = 0.0f;<br />
else if (rho <= light[i].spot.y)<br />
spotFactor = pow(abs(<br />
(rho - light[i].spot.x)/<br />
(light[i].spot.y - light[i].spot.x)),<br />
light[i].spot.z);<br />
}<br />
}<br />
else<br />
attenuationFactor = 0.0f;<br />
}<br />
<br />
// accumulate ambient, diffuse, and specular elements of light<br />
//<br />
ambientLight += attenuationFactor * spotFactor *<br />
light[i].ambient.xyz;<br />
diffuseLight += attenuationFactor * spotFactor * diffuseFactor *<br />
light[i].diffuse.xyz;<br />
specularLight += attenuationFactor * spotFactor *<br />
light[i].specular.xyz * pow(reflectFactor, material.power);<br />
}<br />
<br />
// apply material reflectivity to each accumulated element of light<br />
// to obtain the colour of the lit fragment<br />
//<br />
colour.xyz =<br />
saturate(material.ambient.xyz * ambientLight) +<br />
saturate(material.diffuse.xyz * diffuseLight) +<br />
saturate(material.specular.xyz * specularLight);<br />
colour.w = material.diffuse.w;<br />
}<br />
<br />
// apply texture<br />
//<br />
if (texOn)<br />
colour *= tex2D(tex, raw.texcoord);<br />
<br />
return colour;<br />
}<br />
</syntaxhighlight><br />
<br />
=== To Do ===<br />
* reorganize framework code so that vertex shader receives product of world, view, and projection matrices<br />
** store viewProjection matrix as an instance variable in Display<br />
** pre-multiply viewProjection by world to obtain composite matrix to pass to vertex shader<br />
** add composite matrix to the constant table in the vertex shader<br />
* reorganize framework code to minimize duplication of heading normalization<br />
** perform normalization of heading in APIDisplay::beginDrawFrame()<br />
<br />
=== Resources ===<br />
<br />
<!--<br />
== Week 7 - Feb 20 ==<br />
=== This Week ===<br />
* Effects Framework<br />
=== To Do ===<br />
=== Resources ===<br />
<br />
<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* [http://msdn.microsoft.com/en-us/library/bb147178%28v=VS.85%29.aspx Mathematics of Lighting]<br />
* Lighting in Vertex Shaders<br />
** Notation<br />
**: G<sub>a</sub> - global ambient color<br />
**: C<sub>a</sub> - material ambient color<br />
**: C<sub>d</sub> - material diffuse color<br />
**: C<sub>s</sub> - material specular color<br />
**: L<sub>a<sub>i</sub></sub> - ambient color of light i<br />
**: L<sub>d<sub>i</sub></sub> - diffuse color of light i<br />
**: L<sub>s<sub>i</sub></sub> - specular color of light i<br />
**: L<sub>dir<sub>i</sub></sub> - direction vector of light i<br />
**: N - normal to the surface at the vertex<br />
*** [http://msdn.microsoft.com/en-us/library/bb172279%28v=VS.85%29.aspx Attenuation and Spotlight Factors]<br />
**** Atten<sub>i</sub> - attenuation of light i<br />
***: d<sub>i</sub> - distance from light i<br />
***:: d<sub>i</sub> = |L<sub>dir<sub>i</sub></sub>|<br />
***: a<sub>0</sub> - constant attenuation factor<br />
***: a<sub>1</sub> - linear attenuation factor<br />
***: a<sub>2</sub> - quadratic attenuation factor<br />
***: Atten<sub>i</sub> = 1/(a<sub>0</sub> + a<sub>1</sub> d<sub>i</sub> + a<sub>2</sub> d<sub>i</sub><sup>2</sup>)<br />
***: Atten<sub>i</sub> = [0, 1]<br />
**** Spot<sub>i</sub> - spot factor of light i<br />
***: Spot<sub>i</sub> = {[r<sub>i</sub> - cos(phi<sub>i</sub>/2)]/[cos(theta<sub>i</sub>/2) - cos(phi<sub>i</sub>/2)]}<sup>f<sub>i</sub></sup><br />
***: r<sub>i</sub> - cosine of angle from axis of spotlight<sub>i</sub><br />
***:: r<sub>i</sub> = norm(- light direction in camera space) . norm(L<sub>dir<sub>i</sub></sub>)<br />
***: phi<sub>i</sub> - penumbra (exterior cone) angle of spotlight<sub>i</sub><br />
***: theta<sub>i</sub> - umbra (interior cone) angle of spotlight<sub>i</sub><br />
***: f<sub>i</sub> - falloff factor of spotlight<sub>i</sub><br />
** [http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model Blinn-Phong and Phong]<br />
**: V - viewpoint vector<br />
**:: V = norm(Camera<sub>position</sub> - Vertex<sub>position</sub>)<br />
** Phong - account accurately for position of viewer<br />
**: Specular reflectance = (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup><br />
**: R<sub>i</sub> - reflection vector<br />
**:: R<sub>i</sub> = 2 * (N . L<sub>dir<sub>i</sub></sub>) N - L<sub>dir<sub>i</sub></sub><br />
**: p<sub>i</sub> - true specular power of light i<br />
**:<br />
** Blinn-Phong - use halfway vector instead of reflection vector - adjust power to compensate<br />
**: Specular reflectance = (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup><br />
**: H<sub>i</sub> - halfway vector<br />
**:: H<sub>i</sub> = norm(V + L<sub>dir<sub>i</sub></sub>)<br />
**:: H<sub>i</sub> = norm([0,0,1] + L<sub>dir<sub>i</sub></sub>) - less computationally intensive - assumes that camera is at infinity along z axis<br />
**: p'<sub>i</sub> - adjusted specular power of light i<br />
**:<br />
** [http://msdn.microsoft.com/en-us/library/bb172256%28v=VS.85%29.aspx Ambient]<br />
**: C<sub>a</sub> * ( G<sub>a</sub> + sum [L<sub>a<sub>i</sub></sub> * Atten<sub>i</sub> * Spot<sub>i</sub>] )<br />
** [http://msdn.microsoft.com/en-us/library/bb219656%28v=VS.85%29.aspx Diffuse]<br />
**: C<sub>d</sub> * sum [ L<sub>d<sub>i</sub></sub> * (N . L<sub>dir<sub>i</sub></sub>) * Atten<sub>i</sub> * Spot<sub>i</sub> ]<br />
** [http://msdn.microsoft.com/en-us/library/bb147399%28VS.85%29.aspx Specular]<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Blinn-Phong<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Phong<br />
** [http://msdn.microsoft.com/en-us/library/ff471376%28v=vs.85%29.aspx HLSL Intrinsic Functions]<br />
*** [http://msdn.microsoft.com/en-us/library/bb509630%28v=vs.85%29.aspx normalize()] - normalize a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509594%28v=vs.85%29.aspx dot(,)] - dot product of two vectors of any size<br />
*** [http://msdn.microsoft.com/en-us/library/bb509617%28v=vs.85%29.aspx length()] - length of a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509645%28v=vs.85%29.aspx saturate()] - clamp scalar, vector, or matrix to [0, 1]<br />
=== To Do ===<br />
=== Resources ===<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=81235SQLite Adapter StandUp Reports2012-02-13T14:26:25Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
=Week 9: Mar 5=<br />
=Week 8: Feb 27=<br />
=Week 7: Feb 20=<br />
--><br />
<br />
=Week 6: Feb 13=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
==Monady==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Buidling SQLite with ICU enabled<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=81197SQLite Adapter StandUp Reports2012-02-11T17:03:08Z<p>Gbatumbya: /* Week 5: Feb 6 */</p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
=Week 9: Mar 5=<br />
=Week 8: Feb 27=<br />
=Week 7: Feb 20=<br />
=Week 6: Feb 13=<br />
--><br />
<br />
<br />
=Week 5: Feb 6=<br />
<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj SQlite extension, binary functions<br />
* C code clean up<br />
|<br />
* Fixed bug related to connecting to the same data source concurrently<br />
* Modified rank extension<br />
* Added error handling to extensions<br />
* Building SQLite with ICU enabled<br />
* Implemented appendMatchExpression<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Cleaning up the wiki<br />
* Unicode extension library for sqlite<br />
* Logic to determine which binary to load<br />
|<br />
* Building SQLite with ICU enabled<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Nexj sqlite extension, and the binary() conversion function<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Proper error handling in the binary() extension<br />
* Unicode library extension for sqlite<br />
* Updating wiki with project milestones<br />
* Asking the Community about our multiple attach issue<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=GAM670/DPS905_Weekly_Schedule_20121&diff=80910GAM670/DPS905 Weekly Schedule 201212012-02-08T13:31:09Z<p>Gbatumbya: /* Resources */</p>
<hr />
<div>{{GAM670/DPS905 Index | 20121}}<br />
= GAM670/DPS905 -- Weekly Schedule 20121=<br />
<br />
== Week 1 - Jan 8 ==<br />
<br />
=== This Week ===<br />
* Assignment Discussion<br />
* Suggested Enhancements<br />
* Review of the Base Code<br />
** Definition of a Framework<br />
*** Modularity through stable interfaces<br />
*** Re-usability through generic components<br />
*** Extensibility through hook methods<br />
*** Inversion of control - determines which application methods to invoke in response to external events<br />
** Framework Architecture<br />
*** Modelling Layer<br />
*** API Translation Layer<br />
** Notable Features of the Base Code<br />
** camera, sound, and light are also derived from the Frame class<br />
** textures attach at the object level<br />
** texture connection is uncoupled from drawing of the graphics primitives<br />
** reference frames are relative<br />
** very simple collision detection<br />
<br />
=== To Do ===<br />
<br />
# add your name to the student list<br />
# create a team page that includes the semester number 20121<br />
#* describe the game that you intend to develop<br />
#* list the topics of interest to your team in developing its game<br />
#* list the other topics of interest<br />
<!--<br />
# Port Game Design over to Update Base Code--><br />
<br />
=== Resources ===<br />
<br />
<br />
== Week 2 - Jan 16 ==<br />
<br />
=== This Week ===<br />
<br />
* Relative Reference Frames<br />
** Recursive calls<br />
**: Vector Frame::position()<br />
**: Matrix Frame::rotation()<br />
**: Matrix Frame::world()<br />
** Detaching from and attaching to a parent frame<br />
**: Frame::attachTo()<br />
* Geometry<br />
** Plane<br />
**: normal + constant - examples<br />
**: equation of a plane: dot(n, x) + D = 0<br />
**: positive side of a plane dot(n, x) + D > 0<br />
* Collision Detection<br />
*: types of colliders<br />
*:: spheres<br />
*:: planes<br />
*:: axis-aligned bounding boxes<br />
*:: oriented bounding boxes<br />
<br />
=== To Do ===<br />
* Research the feature that you are going to add and prepare a plan of action<br />
* Prepare a team page for your team so that repos can be ordered<br />
* Add a section to your team page to track your project and solicit commentary<br />
<br />
=== Resources ===<br />
<br />
== Week 3 - Jan 23 ==<br />
=== This Week ===<br />
* Collision Detection (cont'd)<br />
*: Shape<br />
*:: Shape : Frame<br />
*:: Shape::setRadius()<br />
*:: Shape::getRadius()<br />
*:: Shape::setRadius(float r);<br />
*:: Shape::setRadius(float x, float y, float z);<br />
*:: Shape::getRadius() const { return radius; }<br />
*:: Shape::setPlane(Vector n, float d);<br />
*:: Shape::setAxisAligned(Vector min, Vector max);<br />
* Comprehensive Camerawork<br />
*: rotation about an axis<br />
*: order of rotation matters<br />
*: Euler angles<br />
*:: [http://www.youtube.com/watch?v=UpSMNYTVqQI&feature=related 3-2-1 angles]<br />
*: gimbal lock<br />
*:: [http://www.youtube.com/watch?v=rrUCBOlJdt4&feature=related StephenSeefeld.net]<br />
*: complex numbers<br />
*:: solution of cubic equations 16th century<br />
*:: two-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers matrix representation]<br />
*: quaternions<br />
*:: extension of complex numbers<br />
*:: four-dimensional representation<br />
*:: [http://en.wikipedia.org/wiki/Quaternion#Matrix_representations matrix representation]<br />
*: geometric algebra (more abstract)<br />
*:: [http://staff.science.uva.nl/~leo/cinderella/line1.html Dorst's site]<br />
*:: [http://sinai.apphy.u-fukui.ac.jp/gcj/software/GAcindy-1.4/GAcindy.htm Hitzer's site]<br />
* Visibility Determination<br />
**: test a point for presence within a set of planes<br />
**: normal calculations - general rotation matrix - vector and angle<br />
** ViewFrustum<br />
**: parameter - view * projection<br />
**: 6 planes<br />
**:: near and far planes<br />
**:: left and right planes<br />
**:: top and bottom planes<br />
**: coding<br />
**:: constructor<br />
**:: ViewFrustum::contains()<br />
** Finite Size of Objects<br />
**: Expansion of the View Frustum<br />
* Index Buffers<br />
*: amount of storage needed for vertex data<br />
*: duplication of vertex data<br />
*: indexing<br />
*: indexed primitives<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* [http://en.wikipedia.org/wiki/Complex_number Wikipedia on Complex Numbers]<br />
* [http://en.wikipedia.org/wiki/Quaternion Wikipedia on Quaternions]<br />
* [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Wikipedia on quaternions and Spatial Rotations]<br />
* [http://mathworld.wolfram.com/Quaternion.html Wolfram on Quaternions]<br />
* [http://www.cprogramming.com/tutorial/3d/quaternions.html CProgramming.com on Quaternions]<br />
* [http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer Ogre intro on Quaternions]<br />
* collision sample<br />
* indexBuffering sample<br />
<br />
<br />
== Week 4 - Jan 30 ==<br />
=== This Week ===<br />
* Meshes<br />
*: What is a mesh?<br />
*:: vertex list -> vertex buffer<br />
*:: index list -> index buffer<br />
*:: attribute list -> subset to which primitives belong<br />
*:: pyramid sample<br />
*: Stock Objects<br />
*:: Sphere<br />
*::: slices and partitions<br />
*:: Cylinder<br />
*:: Torus<br />
*:: Utah Teapot<br />
*:: APIGraphic.h and .cpp code<br />
*: Custom Mesh<br />
*:: Create a Mesh<br />
*:: FVF settings<br />
*:: DrawSubset<br />
*::: DrawIndexedPrimitive parameters<br />
*:: APIGraphic.h code<br />
*: X File<br />
*:: Create Mesh from File<br />
* SkyBox<br />
*: definition of a skybox<br />
*:: attachment to camera<br />
*:: inverted coordinates<br />
*: skybox textures<br />
*: Graphic.cpp code<br />
*: more complicated forms - skydome<br />
* Billboards<br />
*: definition, purpose of a billboard<br />
*: types of billboards<br />
*:: screen-aligned - useful for annotation text, lens flares<br />
*::: normal is opposite to camera heading<br />
*::: up is camera->up<br />
*:: axial - useful for cylindrical symmetry - trees (textured object does not face straight on)<br />
*::: up is fixed<br />
*::: normal faces the viewer as much as possible<br />
*:: view_plane - no distortion - useful for<br />
*::: normal is fixed (opposite to camera heading)<br />
*::: up is open to change<br />
*:: viewpoint - simulates distortion due to perspective projection - useful for clouds<br />
*::: normal is fixed (difference between viewpoint position and camera heading)<br />
*::: up is open to change<br />
*: Object.h and Object.cpp code<br />
* Texture Filtering<br />
*: mip maps<br />
*:: multum in parvo<br />
*:: texture creation<br />
*:: APITexture::SetSamplerState()<br />
* DirectX Errors<br />
*: DirectX Utilities - Lookup Tool<br />
*: APIDisplay::restore() example<br />
<br />
=== To Do ===<br />
=== Resources ===<br />
* meshes sample<br />
* [http://rbwhitaker.wikidot.com/skyboxes-1 Rob Whitaker on Skyboxes]<br />
* [http://web.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/suman_wk8_IBR.pdf Image Based Rendering - Suman Nadella on Billboarding and Imposters]<br />
* [http://www.digitalrune.com/Products/GameEngine/Particles.aspx DigitalRune]<br />
* [http://en.wikipedia.org/wiki/Mipmap Wikipedia on Texture Filtering]<br />
* [http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx D3D 9 tutorial on modeling with an Index list]<br />
<br />
== Week 5 - Feb 6 ==<br />
=== This Week ===<br />
* Vertex Declarations<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172559%28v=vs.85%29.aspx FVF Codes]<br />
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172630%28v=vs.85%29.aspx D3DVERTEXELEMENT9 struct]<br />
* The Pipeline<br />
*: [http://en.wikipedia.org/wiki/Instruction_pipeline What is a pipeline]<br />
*:<br />
* The GPU<br />
*: [http://en.wikipedia.org/wiki/Graphics_processing_unit What is a GPU]<br />
** nVidia<br />
**: [http://en.wikipedia.org/wiki/Geforce GeForce]<br />
**: [http://en.wikipedia.org/wiki/NVIDIA_Quadro Quadro]<br />
**: [http://en.wikipedia.org/wiki/Nvidia_Tesla Tesla]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units Comparison]<br />
** AMD (previously ATI)<br />
**: [http://en.wikipedia.org/wiki/Radeon_R520 Radeon 520]<br />
**: [http://en.wikipedia.org/wiki/Comparison_of_AMD_graphics_processing_units Comparison]<br />
* Shader Languages<br />
*: [http://en.wikipedia.org/wiki/Shader what is a shader]<br />
*: dedicated shaders<br />
*: [http://en.wikipedia.org/wiki/Unified_shader_model unified shaders]<br />
*: how does a shader work<br />
** Languages<br />
**: [http://en.wikipedia.org/wiki/HLSL HLSL - Microsoft]<br />
**: [http://en.wikipedia.org/wiki/Cg_%28programming_language%29 Cg - nVidia]<br />
**: [http://en.wikipedia.org/wiki/GLSL GLSL - OpenGL (Khronos)]<br />
* Vertex Shaders<br />
* Pixel Shaders<br />
* effect of skybox and point light on frame rate<br />
<br />
=== To Do ===<br />
* reorganize framework code so that vertex shader receives product of world, view, and projection matrices<br />
** store viewProjection matrix as an instance variable in Display<br />
** add viewProjection query to Display to extract product of view and projection matrices<br />
** retrieve viewProjection in *::draw() method<br />
** pre-multiply viewProjection by world to obtain composite matrix to pass to vertex shader<br />
** add composite matrix to the constant table in the vertex shader<br />
* reorganize framework code to minimize duplication of heading normalization<br />
** perform normalization of heading in Display::beginDraw()<br />
<br />
<!--<br />
== Week 6 - Feb 13 ==<br />
=== This Week ===<br />
* Effects Framework<br />
=== To Do ===<br />
=== Resources ===<br />
<br />
== Week 7 - Feb 20 ==<br />
=== This Week ===<br />
=== To Do ===<br />
=== Resources ===<br />
<br />
<br />
== Week 8 - Mar 4 ==<br />
=== This Week ===<br />
* [http://msdn.microsoft.com/en-us/library/bb147178%28v=VS.85%29.aspx Mathematics of Lighting]<br />
* Lighting in Vertex Shaders<br />
** Notation<br />
**: G<sub>a</sub> - global ambient color<br />
**: C<sub>a</sub> - material ambient color<br />
**: C<sub>d</sub> - material diffuse color<br />
**: C<sub>s</sub> - material specular color<br />
**: L<sub>a<sub>i</sub></sub> - ambient color of light i<br />
**: L<sub>d<sub>i</sub></sub> - diffuse color of light i<br />
**: L<sub>s<sub>i</sub></sub> - specular color of light i<br />
**: L<sub>dir<sub>i</sub></sub> - direction vector of light i<br />
**: N - normal to the surface at the vertex<br />
*** [http://msdn.microsoft.com/en-us/library/bb172279%28v=VS.85%29.aspx Attenuation and Spotlight Factors]<br />
**** Atten<sub>i</sub> - attenuation of light i<br />
***: d<sub>i</sub> - distance from light i<br />
***:: d<sub>i</sub> = |L<sub>dir<sub>i</sub></sub>|<br />
***: a<sub>0</sub> - constant attenuation factor<br />
***: a<sub>1</sub> - linear attenuation factor<br />
***: a<sub>2</sub> - quadratic attenuation factor<br />
***: Atten<sub>i</sub> = 1/(a<sub>0</sub> + a<sub>1</sub> d<sub>i</sub> + a<sub>2</sub> d<sub>i</sub><sup>2</sup>)<br />
***: Atten<sub>i</sub> = [0, 1]<br />
**** Spot<sub>i</sub> - spot factor of light i<br />
***: Spot<sub>i</sub> = {[r<sub>i</sub> - cos(phi<sub>i</sub>/2)]/[cos(theta<sub>i</sub>/2) - cos(phi<sub>i</sub>/2)]}<sup>f<sub>i</sub></sup><br />
***: r<sub>i</sub> - cosine of angle from axis of spotlight<sub>i</sub><br />
***:: r<sub>i</sub> = norm(- light direction in camera space) . norm(L<sub>dir<sub>i</sub></sub>)<br />
***: phi<sub>i</sub> - penumbra (exterior cone) angle of spotlight<sub>i</sub><br />
***: theta<sub>i</sub> - umbra (interior cone) angle of spotlight<sub>i</sub><br />
***: f<sub>i</sub> - falloff factor of spotlight<sub>i</sub><br />
** [http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model Blinn-Phong and Phong]<br />
**: V - viewpoint vector<br />
**:: V = norm(Camera<sub>position</sub> - Vertex<sub>position</sub>)<br />
** Phong - account accurately for position of viewer<br />
**: Specular reflectance = (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup><br />
**: R<sub>i</sub> - reflection vector<br />
**:: R<sub>i</sub> = 2 * (N . L<sub>dir<sub>i</sub></sub>) N - L<sub>dir<sub>i</sub></sub><br />
**: p<sub>i</sub> - true specular power of light i<br />
**:<br />
** Blinn-Phong - use halfway vector instead of reflection vector - adjust power to compensate<br />
**: Specular reflectance = (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup><br />
**: H<sub>i</sub> - halfway vector<br />
**:: H<sub>i</sub> = norm(V + L<sub>dir<sub>i</sub></sub>)<br />
**:: H<sub>i</sub> = norm([0,0,1] + L<sub>dir<sub>i</sub></sub>) - less computationally intensive - assumes that camera is at infinity along z axis<br />
**: p'<sub>i</sub> - adjusted specular power of light i<br />
**:<br />
** [http://msdn.microsoft.com/en-us/library/bb172256%28v=VS.85%29.aspx Ambient]<br />
**: C<sub>a</sub> * ( G<sub>a</sub> + sum [L<sub>a<sub>i</sub></sub> * Atten<sub>i</sub> * Spot<sub>i</sub>] )<br />
** [http://msdn.microsoft.com/en-us/library/bb219656%28v=VS.85%29.aspx Diffuse]<br />
**: C<sub>d</sub> * sum [ L<sub>d<sub>i</sub></sub> * (N . L<sub>dir<sub>i</sub></sub>) * Atten<sub>i</sub> * Spot<sub>i</sub> ]<br />
** [http://msdn.microsoft.com/en-us/library/bb147399%28VS.85%29.aspx Specular]<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (N . H<sub>i</sub>)<sup>p'<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Blinn-Phong<br />
**: C<sub>s</sub> * sum [ L<sub>s<sub>i</sub></sub> * (R<sub>i</sub> . V)<sup>p<sub>i</sub></sup> * Atten<sub>i</sub> * Spot<sub>i</sub> ] - Phong<br />
** [http://msdn.microsoft.com/en-us/library/ff471376%28v=vs.85%29.aspx HLSL Intrinsic Functions]<br />
*** [http://msdn.microsoft.com/en-us/library/bb509630%28v=vs.85%29.aspx normalize()] - normalize a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509594%28v=vs.85%29.aspx dot(,)] - dot product of two vectors of any size<br />
*** [http://msdn.microsoft.com/en-us/library/bb509617%28v=vs.85%29.aspx length()] - length of a vector<br />
*** [http://msdn.microsoft.com/en-us/library/bb509645%28v=vs.85%29.aspx saturate()] - clamp scalar, vector, or matrix to [0, 1]<br />
=== To Do ===<br />
=== Resources ===<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=80629SQLite Adapter StandUp Reports2012-02-06T02:30:17Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
=Week 9: Mar 5=<br />
=Week 8: Feb 27=<br />
=Week 7: Feb 20=<br />
=Week 6: Feb 13=<br />
--><br />
<br />
<br />
=Week 5: Feb 6=<br />
<!--<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Updated software design document<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading <br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=NexJ_Express&diff=80621NexJ Express2012-02-06T00:09:43Z<p>Gbatumbya: listing -> list</p>
<hr />
<div>{{NexJ_Express Index}}<br />
<br />
{|border="0" cellspacing="0" cellpadding="0" style="padding:0px; margin:0px;" |<br />
|-<br />
| colspan="3" valign="top" |<br />
{{Robelbox|theme=13|title=Introduction}}<br />
<div style="{{Robelbox/pad}}"><br />
NexJ Model Server Express is an open source [http://java.sun.com/javaee/ Java EE-based] execution server specialized to enterprise integration applications. It provides services for deploying highly scalable, fault-tolerant, distributed enterprise solutions. NexJ Model Server Express provides:<br />
<br />
<br />
* Business Object Engine - supports a single-inheritance class structure as well as aspects to provide specific application characteristics<br />
* Workflow Engine - persistent, long-running asynchronous UML activities that are initiated by and act on business class instances<br />
* Persistence Engine - connect your model to multiple data sources (relational, XML file) in a database-independent way. Connect to multiple data sources at runtime leveraging different database adapters<br />
* Integration Engine - model message-based communication between the running model and other systems. The engine supports multiple protocols and message formats<br />
* Security Engine - design a privilege-based security model and apply it throughout the other [http://www.rentalprotectionagency.com/tenant-screening.php/ background check] model layers<br />
<br />
<br />
<br />
NexJ's approach to model-driven engineering (MDE), support by the model-execution capabilities of NexJ Model Server Express, greatly simplifies the process of developing enterprise applications. Using NexJ Express Studio, developers focus on solving the business problems while the NexJ Framework handles technical complexities of running that solution.<br />
</div><br />
<div style="border-top:1px solid #8488DC; border-bottom:1px solid #8488DC; background-color:#CED1FA; padding:0.2em 0.9em 0.2em 0.5em; font-size:110%;">Industry Partnership<br />
</div><br />
<div style="height:10px"> </div><!--spacer--><br />
<div style="{{Robelbox/pad}}"><br />
[[Image:Nexj-logo.jpg|right|122px]][http://cdot.senecac.on.ca Seneca CDOT] in partnership with [http://www.nexj.com NexJ Systems] (a leading provider of enterprise private cloud software, delivering enterprise customer relationship management (CRM) solutions to the financial services, insurance, and healthcare industries) work to both add and enhance existing functionality to NexJ Express. NexJ Express is part of [http://www.openhealthtools.org Open Health Tools(OHT)] serving as the [http://tinyurl.com/oht-aip Application Intergration Platfrom(AIP)]<br />
<br />
</div><br />
{{Robelbox/close}}<br />
<br/><br />
|-<br />
| colspan="3" valign="top" |<br />
{{Robelbox | theme=12|title=Contributors}}<br />
<div style="{{Robelbox/pad}}"><br />
Faculty<br />
* [[User:JAnastasiade| Jordan Anastasiade]]<br />
* [[User:Pliu | Peter Liu]]<br />
<br />
<br />
Research Assistants<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[Minooz/Projects | Minoo Ziaei]]<br />
* [[User:AnastasiaS | Anastasia Semionova]]<br />
* [[Tung-NexJ-Page | Tung Pui Cheung]] (Visual Guides & Videos)<br />
* [[User:Brianlim | Brian Lim]]<br />
* [[User:Cwdesautels | Carl Desautels]]<br />
* [[User:Abhishekbh | Abhishek Bhatnagar]]<br />
* [[User:Wei.song | Wei Song]]<br />
</div><br />
{{Robelbox/close}}<br />
<br/><br />
|-<br />
| width=33% valign=top |<br />
{{Robelbox|theme=1|title=[[:Category:NexJ Current Projects|Current Projects]]}}<br />
<div style="{{Robelbox/pad}};height:300px; overflow:auto;"><br />
Below is a list of projects that CDOT is actively contributing to<br />
<categorytree mode=all hideroot=on>NexJ Current Projects</categorytree><br />
</div><br />
{{Robelbox/close}}<br />
| width=33% valign=top |<br />
{{Robelbox|theme=1|title=[[:Category:NexJ Past Projects|Completed Projects]]}}<br />
<div style="{{Robelbox/pad}};height:300px; overflow:auto;"><br />
Below is a list of projects that CDOT has successfully completed<br />
<categorytree mode=all hideroot=on>NexJ Past Projects</categorytree><br />
</div><br />
{{Robelbox/close}}<br />
|} <br />
<br />
<!--<br />
= Human Resources=<br />
<br />
December 10, 2010 <br />
<br />
[[Image:Grace-Peter-Minoo-Dec10-10.jpg| Grace, Peter, Minoo | 800px]]<br />
::Minoo, Peter, Grace (from left to right)<br />
<br />
[[Image:Minoo-Jordan-Grace-Dec10-10.jpg| Grace, Peter, Minoo | 800px]]<br />
::Minoo, Jordan, Grace<br />
<br />
--></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80577JSON Integration Adapter2012-02-04T16:20:32Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Past Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
* '''Completed''' (February 02, 2012)<br />
<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
<br />
== Definitions ==<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
* Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
===Phase 8. Apply Changes from Code Review 2===<br />
*[[JSON_Integration_Adapter_Code_Review_2_Changes | Changes to make]]<br />
<br />
===Phase 9. Code Review 3===<br />
* Week of November 14<br />
<br />
===Phase 10. Apply Changes from Code Review 3===<br />
*[[JSON_Integration_Adapter_Code_Review_3_Changes | Changes to make]]<br />
<br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=PostgreSQL_Adapter&diff=80576PostgreSQL Adapter2012-02-04T16:20:13Z<p>Gbatumbya: /* Current Status */</p>
<hr />
<div><big><big> PostgreSQL Adapter for NexJ </big></big><br />
{{NexJ_Express Index}}<br />
[[category: NexJ Past Projects]]<br />
[[category: NexJ Express PostgreSQL]]<br />
<br />
<br />
== Project Goal==<br />
Develop an adapter to enable NexJ Express model to interact with PostgreSQL database.<br />
<br />
===Contributors===<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[Minooz/Projects | Minoo Ziaei]]<br />
* [[User:AnastasiaS | Anastasia Semionova]]<br />
<br />
<br />
=== Supported PostgreSQL Versions===<br />
* 8.4+<br />
<br />
<br />
== Current Status==<br />
* '''Completed''' (October 21, 2011)<br />
* Get the last PostgreSQL adapter source code from http://mercurial.nexj.com/express.cgi/core<br />
<br />
<!--{|class="collapsible collapsed" style="border-style:solid;border-width:thin;border-color:black"<br />
!align="left" style="background-color:SteelBlue; font-weight:bold;border-style:solid;border-width:thin;padding: 2px 2px 2px 2px;"| Dec 2010 <br />
|- <br />
|<br />
* Database 'test' is created in Postgre.<br />
* sample table 'mutex' is created for testing the connection properties. <br />
* No need for SET SQL mode in Postgre<br />
* Creating tables in process <br />
* Tables are created.<br />
* Creating indexes and triggers in process<br />
|}<br />
<br />
{|class="collapsible collapsed" style="border-style:solid;border-width:thin;border-color:black"<br />
!align="left" style="background-color:SteelBlue; font-weight:bold;border-style:solid;border-width:thin;padding: 2px 2px 2px 2px;"| Nov 2010 <br />
|-<br />
|<br />
* Walk through parts of code related to SQLadapter, SqlSchemaManger and setup scripts in NexJ Express code<br />
* SQLAdapter (src, test) and SQLSchemaManager (src, test) classes are extended to create PostgreSQL classes<br />
* Proper PostgreSQL Driver is installed.<br />
* Postgre package url for XADataSource is added to the related files.<br />
* cofig and connection files are modified based on Postgre properties<br />
* Application is now connected to the Postgre database.<br />
|}<br />
--><br />
<br />
==Project Phases==<br />
=== Phase 1: Investigation (DONE) ===<br />
* Get requirements from NexJ (Meeting on Friday Nov 5th)<br />
* Walk-through the code<br />
* Familiarization with PostgreSQL<br />
<br />
=== Phase 2: Connect to PostgreSQL server (DONE) ===<br />
* [[NexJ_Express_Connecting_to_PostgreSQL| Connect to PostgreSQL server]]<br />
<br />
=== Phase 3: PostgreSQLSchemaManager (DONE) ===<br />
* Estimated Duration: 3 weeks (Jan 17 - Feb 11, 2011)<br />
* [[PostgreSQL Adapter-nexj/extendingSchemaManager | Extending SQLSchemaManager ]]<br />
<br />
=== Phase 4: PostgreSQLAdapter (DONE)===<br />
* Estimated Duration: 3 weeks (Feb 14 - 25, 2011)<br />
* [[PostgreSQL_Adapter-nexj/extendingSQLAdapter | Extending SQLAdapter ]]<br />
<br />
===Phase 5: PostgreSQL UnitTests and Optimization (DONE) ===<br />
* Estimated Duration: 2 weeks (Feb 28 - Mar 11, 2016)<br />
* Add database specific tests fostr PostgreSQL<br />
*:test for required contrib scripts<br />
*:test for custom blob read & write functions<br />
* Add PostgreSQL specific optimization<br />
<br />
===Phase 6: Megre Code with Latest Revision (DONE) ===<br />
* Merge code with lastest revision from http://mercurial.nexj.com/express<br />
<br />
===Phase 7: Test with NexJ Express Studio (DONE) ===<br />
* Estimated duration: Mar 7- Apr 14, 2011<br />
* Run model in Express studio using the postgresql adapter<br />
* create scripts for database initialization, creation and dumping<br />
* create scripts for JBoss<br />
* Deploy to JBoss<br />
<br />
=== Phase 8: Code Review 1 - Meeting (DONE) ===<br />
* Date: Apr 20,2011 <br />
* Meet with NexJ Developer to review code<br />
<br />
=== Phase 9: Code Review 1 - Apply Changes (DONE) ===<br />
* Estimated Duration: Apr 20, 2011 - July 1, 2011<br />
* [[PostgreSQL_Adapter_Project_-_Code_Review_1_Changes | Changes to be made]]<br />
<br />
=== Phase 10: Code Review 2 (DONE) ===<br />
* Send code for review<br />
*<br />
<br />
=== Phase 11: Code Review 2 - Apply Changes (DONE) ===<br />
* Estimated Duration: July 7, 2011 - July 15, 2011<br />
* [[PostgreSQL_Adapter_Project_-_Code_Review_2_Changes | Changes to be made]]<br />
<br />
=== Phase 12: Code Review 3 (DONE) ===<br />
* Sent code for code review 3<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/08cdedb9d071/<br />
<br />
=== Phase 13: Code Review 3 - Apply Changes (DONE) ===<br />
* Upgrade to lastest 7.1 branch<br />
* Create Statement and PreparedStatementProxy<br />
* Create PostgreSQLPreparedStatementProxy:<br />
** implement set/getQueryTimeout<br />
** move custom timeout code into this proxy<br />
* Override prepareStatement in PostgreSQL to return PostgreSQLPreparedStatementProxy<br />
* Implement implicit save points for statements within a transaction block<br />
* Modify readSchema to use addColumn for reading columns from the database<br />
** Remove MSSQL and Oracle specific code from addColumn<br />
** Override addColumn in PostgreSQL for text, bytea and lo types<br />
<br />
=== Phase 14: Integration Tests (DONE) ===<br />
* Run Integration tests against the Adapter<br />
<br />
=== Phase 15: Code Review 4 (DONE)===<br />
* Code review with framework architect<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/6c9a7380c8fe<br />
<br />
=== Phase 16: Code Review 4 - Apply Changes (DONE) ===<br />
* Estimated Duration: Sep 9 - Sep 12<br />
* [[PostgreSQL_Adapter_Project_-_Code_Review_4_Changes | Changes to be made]]<br />
<br />
=== Phase 17: Code Review 5 (DONE) ===<br />
* Submitted code for review on Sep 20.<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/a0d10ef7cdbe/<br />
<br />
=== Phase 18: Code Review 5 - Apply Changes (DONE) ===<br />
<br />
=== Phase 19: Code Review 6 ===<br />
* Date: Oct 13<br />
* Submitted for code review<br />
* https://bitbucket.org/gbatumbya/postgresql_external/src/153aec847d54/<br />
<br />
<br />
<br />
== Project Repository ==<br />
* URL for central repository of the project is: https://bitbucket.org/gbatumbya/postgresql_external<br />
<br />
* Steps to work with the repository<br />
<br />
:1- Follow the [https://www.projects.openhealthtools.org/sf/docman/do/downloadDocument/projects.oht_aip/docman.root.nexj_studio_express_v7_1_113_0/doc1783/1 instructions to create the NexJ Express workspace ].<br />
:2- After creating 'ws' directory,<br />
::open Eclipse and<br />
::click on '''File -> Import -> Mercurial -> Clone Existing Mercurial Repository'''<br />
:: Enter this information:<br />
::: '''URL''': https://bitbucket.org/gbatumbya/postgresql_external<br />
<!--<br />
:3- The central repository's structure is:<br />
:: Main branch called 'default' <br />
:: Branches for<br />
:4- After cloning the project, follow these steps to add a new branch with your user name:<br />
:: First make sure the active branch is 'default'. Notice the top of the Package Explorer e.g. ''core[5:b8b2f102343@'''default'''(tip)]''<br />
:: Right click on 'core' in the Package Explorer<br />
:: Click on 'Team' -> Add Branch<br />
:: Enter the branch name in the box -> Finish<br />
:: Enter the commit message -> OK<br />
:: Check the 'Force Push' if applicable.<br />
:: Now the branch name at the top of Package Explorer is changed to the new branch name. <br />
: 5- To switch to a different branch, choose 'Switch' instead of 'Add Branch'<br />
<br />
* '''NOTE!''' To avoid any conflict, do the 'Pull' every day and before any push.<br />
* '''NOTE!''' First just 'Commit' changesets and do not 'Push' them until the end of the day or the time you are confident by latest changes to the code, then 'Push' them all at once and 'Merge' them with the 'default' branch in central repository.<br />
--><br />
<br />
<br />
== Resources ==<br />
* Downloads<br />
Linux binaries http://www.openscg.org/se/postgresql/packages.jsp<br />
* Debugging<br />
:[[Run_Junit_Tests_For_Non_Default_SQL_Adapter | Unit Testing for non Default SQL Adapter]]<br />
:<br />
* Intro<br />
:Concept of Adapter [http://www.vogella.de/articles/DesignPatternAdapter/article.html]<br />
:FOSSLC [http://www.fosslc.org/drupal/category/community/databases/postgresql PostgreSQL]<br />
* [[PostgreSQL_Adapter-nexj/Resources#Java | Java ]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#Database_.26_Persistence | Database & Persistence]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#JDBC | JDBC]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#PostgreSQL Specifications | PostgreSQL Specifications]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#MySQL_Specifications | MySQL Specifications]]<br />
* [[PostgreSQL_Adapter-nexj/Resources#PostgreSQL_-_MySQL_Compare | Postgre - MySQL Compare]]<br />
<br />
<br />
== Summary of Applied Research ==<br />
* [[Research Findings - PostgreSQLAdapter]]<br />
* [[Research Notes - PostgreSQLAdapter]]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80575JSON Integration Adapter2012-02-04T16:19:19Z<p>Gbatumbya: /* Current Status */</p>
<hr />
<div>[[category: NexJ Past Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
* '''Completed''' (February 02, 2012)<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
<br />
== Definitions ==<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
* Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
===Phase 8. Apply Changes from Code Review 2===<br />
*[[JSON_Integration_Adapter_Code_Review_2_Changes | Changes to make]]<br />
<br />
===Phase 9. Code Review 3===<br />
* Week of November 14<br />
<br />
===Phase 10. Apply Changes from Code Review 3===<br />
*[[JSON_Integration_Adapter_Code_Review_3_Changes | Changes to make]]<br />
<br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80574JSON Integration Adapter2012-02-04T16:18:16Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Past Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
*Completed (February 02, 2012)<br />
<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
<br />
== Definitions ==<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
* Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
===Phase 8. Apply Changes from Code Review 2===<br />
*[[JSON_Integration_Adapter_Code_Review_2_Changes | Changes to make]]<br />
<br />
===Phase 9. Code Review 3===<br />
* Week of November 14<br />
<br />
===Phase 10. Apply Changes from Code Review 3===<br />
*[[JSON_Integration_Adapter_Code_Review_3_Changes | Changes to make]]<br />
<br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80573JSON Integration Adapter2012-02-04T16:16:44Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
*Completed (February 02, 2012)<br />
<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
<br />
== Definitions ==<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
* Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
===Phase 8. Apply Changes from Code Review 2===<br />
*[[JSON_Integration_Adapter_Code_Review_2_Changes | Changes to make]]<br />
<br />
===Phase 9. Code Review 3===<br />
* Week of November 14<br />
<br />
===Phase 10. Apply Changes from Code Review 3===<br />
*[[JSON_Integration_Adapter_Code_Review_3_Changes | Changes to make]]<br />
<br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80572JSON Integration Adapter2012-02-04T16:15:44Z<p>Gbatumbya: /* Current Status */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
*Completed (February 02, 2012)<br />
<br />
== Definitions ==<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
* Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
===Phase 8. Apply Changes from Code Review 2===<br />
*[[JSON_Integration_Adapter_Code_Review_2_Changes | Changes to make]]<br />
<br />
===Phase 9. Code Review 3===<br />
* Week of November 14<br />
<br />
===Phase 10. Apply Changes from Code Review 3===<br />
*[[JSON_Integration_Adapter_Code_Review_3_Changes | Changes to make]]<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80571JSON Integration Adapter2012-02-04T16:14:39Z<p>Gbatumbya: /* Project Phases */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
*Completed<br />
<br />
<br />
== Definitions ==<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
* Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
===Phase 8. Apply Changes from Code Review 2===<br />
*[[JSON_Integration_Adapter_Code_Review_2_Changes | Changes to make]]<br />
<br />
===Phase 9. Code Review 3===<br />
* Week of November 14<br />
<br />
===Phase 10. Apply Changes from Code Review 3===<br />
*[[JSON_Integration_Adapter_Code_Review_3_Changes | Changes to make]]<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter_Code_Review_3_Changes&diff=80570JSON Integration Adapter Code Review 3 Changes2012-02-04T16:14:04Z<p>Gbatumbya: /* JSONMessageFormatter.java */</p>
<hr />
<div>[[category: NexJ Express JSON Message Adapter]]<br />
<br />
===== General =====<br />
The most important changes are:<br />
* Changing the terminology and the mapping property type around the mapping modes.<br />
* Removing the circular ref and OID support, since they do not make sense for the integration engine.<br />
* Refactoring of the message parser to remove the duplicated parsing logic (there are two possible approaches with this)<br />
*Spaces generally must not be removed from existing files, as a trivial change and a goal in itself, since it makes it very hard to apply patches to already modified code.<br />
These include src/nexj/core/scripting/GenericParser.java and /core/test/nexj/core/integration/format/xml/XMLMessageParserTest.java<br />
<br />
<br />
=====GenericParser.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Please undo (I have found only trivial space-removal changes)<br />
|Complete<br />
|}<br />
<br />
<br />
=====XML_FormatString.message, XMLMessageParserTest.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Why have these been changed? Please undo.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONWriter.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Please undo all the method renaming - this breaks a number of classes in the enterprise project, and was not needed in the first place.<br />
Trivial code modifications are discouraged, since they tend to complicate merges and sometimes, like in this case, even break code.<br />
|Complete<br />
|-<br />
| Remove TOKEN_END_OBJECT and TOKEN_END_ARRAY public constants.<br />
The object and array should be closed by invoking a corresponding method on JSONWriter.<br />
Having these constants exposes implementation details and breaks any attempts to subclass this class.<br />
|Complete<br />
|-<br />
|Remove writeBoolean(Boolean). It will break if the value is null, and is not really needed. Invoke writeBoolean(boolean) instead.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMarshaller.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Undo the trivial method renaming<br />
|Complete<br />
|}<br />
<br />
<br />
=====baseTypes.xsd=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Array is JSON - leave only one space after JSON<br />
|Complete<br />
|-<br />
|Node -> message part<br />
|Complete<br />
|-<br />
|'It is also called "typed array".' -> remove this phrase<br />
|Complete<br />
|-<br />
|typed array -> root. Put this after the array.<br />
|Complete<br />
|-<br />
|mode -> subtype<br />
|Complete<br />
|-<br />
|Use an enum instead of an integer for mode, this is far more developer friendly, and does not need a coding table: e.g. subtype="array|root". The subtype should be empty by default.<br />
|Complete<br />
|-<br />
| We should have a "name" attribute for mapping object part keys, as well as subtypes for dates and binary values, like in the XML formatter<br />
|Complete<br />
|}<br />
<br />
<br />
=====en.strings=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| err.integration.json.parse.binary.expectedString=Error parsing binary for "{0}", was expecting a string value but found\: {1}. <br/><br />
-> err.integration.json.parse.binary=Invalid binary value for message part "{0}" (expected a string).<br />
|Complete<br />
|-<br />
|Do not include actual data values in error messages, for privacy reasons. <br/><br />
err.integration.json.parse.binary.invalidBase64=Invalid base64 format for message part "{0}". <br/><br />
-> err.integration.json.parse.base64=Invalid base64 value for message part "{0}".<br />
|Complete<br />
|-<br />
|*err.integration.json.parse.duplicateKey=Found duplicate key\: "{0}". <br/><br />
-> err.integration.json.parse.duplicateKey=Duplicate object key\: "{0}". <br />
*Can you include the message part path in the message? <br />
|Complete<br />
|-<br />
|err.integration.json.parse.oidExpectedString=Error parsing OID for "{0}", was expecting a string value but found\: {1}.<br/><br />
-> err.integration.json.parse.oid =Invalid OID for message part "{0}" (expected a string).<br />
|Complete<br />
|-<br />
|err.integration.json.parse.oidInvalidBase64=Error parsing OID for "{0}", invalid base64 format at\: Line "{1}", Column "{2}". <br/><br />
-> err.integration.json.parse.base64= Invalid base64 value for message part "{0}".<br />
|Complete<br />
|-<br />
| err.integration.json.parse.primitiveTypeMismatch=Error parsing "{0}", was expecting a {1} value but found\: {2}. <br/><br />
-> err.integration.json.parse.typeMismatch=Type mismatch in message part "{0}" (expected a "{1}").<br />
|Complete<br />
|-<br />
|err.integration.json.parse.requiredValueNull=Error parsing "{0}", required part cannot be "null". <br/><br />
-> err.integration.json.parse.requiredNull=Required message part "{0}" is null.<br />
|Complete<br />
|-<br />
|err.integration.json.parse.timestamp=Error parsing timestamp for "{0}", was expecting a number value but found\: {1}. <br/><br />
-> err.integration.json.parse.timestamp=Invalid timestamp for message part "{0}" (expected a numeric value).<br />
|Complete<br />
|-<br />
|err.integration.json.parse.unexpectedToken=Error parsing "{0}", was expecting "{1}" but found "{2}". <br/><br />
-> err.integration.json.parse.unexpectedToken=Unexpected token in message part "{0}" (expected "{1}").<br />
|Complete<br />
|-<br />
|err.meta.integration.json.anyOrdinalCannotHaveFormat=Primitive message part "{0}" of type any ordinal cannot have a format string.<br/><br />
-> err.meta.integration.json.anyFormat=Primitive message part "{0}" of type any cannot have a format pattern.<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidMessageFormatMode=Invalid message format mode "{0}" in RootJSONMessagePartMapping for "{1}". <br/><br />
-> err.meta.integration.json.invalidSubtype=Invalid subtype "{0}" in the mapping of message part "{1}".<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidTypedArray.notCollection=Typed array message {0} child part must be a collection. <br/><br />
-> no, not really. Remove.<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidTypedArray.notOnePart=Typed array message {0} may only have one child part. <br/><br />
-> err.meta.integration.json.rootChild =Root message part "{0}" must have exactly one child part.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessagePartMapping.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|move m_sFormat, m_bQuote up, into the // attributes section - this is a coding convention<br />
|Complete<br />
|-<br />
|m_bQuote -> m_bQuoted<br />
|Complete<br />
|-<br />
|ToBeQuoted -> Quoted<br />
|Compelte<br />
|-<br />
|Group setter and getters together logically, in the beginning of the operations: setter1 getter1 setter2 getter2... <br/><br />
Having the operations grouped alphabetically makes it hard to read the code.<br />
|Complete<br />
|}<br />
<br />
<br />
=====RootJSONMessagePartMapping.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| RootJSONMessagePartMapping -> CompositeJSONMessagePartMapping (since it is not just for the root message part, right?)<br />
|Complete<br />
|-<br />
|m_nMessageFormat -> m_nSubtype<br />
|Complete<br />
|-<br />
|Defaults to {@link RootJSONMessagePartMapping#FORMAT_OBJECT}. - remove the comment and assign the actual value instead.<br />
|Complete<br />
|-<br />
|static final -> final static (convention)<br />
|Complete<br />
|-<br />
|FORMAT_ -> SUBTYPE_<br />
|Complete<br />
|-<br />
|FORMAT_TYPED_ARRAY -> SUBTYPE_ROOT = 2<br />
|Complete<br />
|-<br />
|Move constants up, before the attributes<br />
|Complete<br />
|-<br />
|MessageFormatMode -> Subtype; The validation is not needed, since it will be validated in the loader when parsing the symbol value.<br />
|Complete<br />
|}<br />
<br />
<br />
=====XMLJSONMessageMappingLoader.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|<code>throw new MetadataException("err.meta.integration.json.anyOrdinalCannotHaveFormat", new Object[]{part.getFullPath()});</code><br />
*Try to do this validation in the mapping instead<br />
*The same applies to the format validation and the business logic for setting the quoted flag - move to the mapping<br />
|Complete<br />
|-<br />
|<br />
<code>if (!"true".equals(sFormat) || !"false".equals(sFormat))</code> <br />
-> this always evaluates to true - please fix the logic. <br/><br />
A format that is just "true" or just "false" seems uncommon though. Did you mean "true;false"?<br />
|Compelte<br />
|-<br />
|All regexp pattern should be precompiled in final static constants.<br />
|Complete<br />
|}<br />
<br />
=====JSONMessageFormatter.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|We should format or parse message part without OIDs and circular refs. <br/><br />
The integration engine is designed to deal with hierarchical messages and circular ones can get it into faulty code paths. <br/><br />
It is supposed to support only the most basic conventions and not output or expect messages that require special handling from the external system. <br/><br />
This is needed to facilitate easy integration. Circular refs and OIDs are used in our RPC marshaller, but the goals of the integration engine are quire different. <br/><br />
|Complete<br />
|-<br />
| m_objectMap - not needed anymore<br />
|Complete<br />
|-<br />
|formatCompositeMessagePart - instead of using nChar, invoke the corresponding writer output methods.<br />
|Complete<br />
|-<br />
|Remove the OID management code<br />
|Complete<br />
|-<br />
| Add code for handling the primitive subtypes (hex, base64, dateTime, date, time)<br />
|Complete<br />
|-<br />
|<br />
<code>|| ((nMinCount == nMaxCount) && (nCount != nMinCount))</code> this condition is invalid and will produce an incorrect error message<br />
|Complete<br />
|-<br />
|Do not use j as a counter. Use k instead. j looks like i under many fonts.<br />
|Complete<br />
|-<br />
|writePrimitive - use a switch for nPartType, rather than several if statements.<br />
|Complete<br />
|}<br />
<br />
=====JSONMessageParser.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|m_objectMap - not needed anymore<br />
|Complete<br />
|-<br />
|The overridden methods, like parseObject(), parseElement(), parseArray() etc have a very similar logic to the superclass methods. To avoid duplication, it is better to handle any custom logic needed in these with template methods, like constructing a TransferObject instead of a hashtab e.g. Object createObject(), addObjectValue(Object obj, String sKey, Object value), createArray(), Object addArrayValue(Object array, Object value). <br/><br />
The overriden methods parse* will save and restore the current message part and will check if the structure they parse corresponds to the current message part type and mapping. <br/><br />
This should not introduce a dependency on the integration classes in JSONParser. <br/><br />
Keep the template methods simple. <br/><br />
Alternatively, do not override the base class parse* methods, but just convert the parsing results to transfer objects on a second pass (this can help with message tables, see below).<br />
|Complete (Implemented a hybrid, message table parsing uses a second pass, while direct parsing uses overridden methods)<br />
|-<br />
|It should be possible to parse a primitive message, e.g. 1 or "abc". The mapping for this has subtype="root" and the only message part corresponds to this primitive type.<br />
|Complete<br />
|-<br />
|parsePartValue - m_currentMessagePart .isCollection() - remove the space<br />
|Complete<br />
|- <br />
|initializeMessageTable - it is possible to support more than one message with an object subtype. The mapping can support an additional property key="<key>:<value>", designating a key and a value, which must establish a unique combination for identifying the message in the table. This way we can have also message polymorphism (later phase?).<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessageTest.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| FORMART -> FORMAT<br />
|Complete<br />
|}</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter_Code_Review_3_Changes&diff=80569JSON Integration Adapter Code Review 3 Changes2012-02-04T16:13:44Z<p>Gbatumbya: /* XMLJSONMessageMappingLoader.java */</p>
<hr />
<div>[[category: NexJ Express JSON Message Adapter]]<br />
<br />
===== General =====<br />
The most important changes are:<br />
* Changing the terminology and the mapping property type around the mapping modes.<br />
* Removing the circular ref and OID support, since they do not make sense for the integration engine.<br />
* Refactoring of the message parser to remove the duplicated parsing logic (there are two possible approaches with this)<br />
*Spaces generally must not be removed from existing files, as a trivial change and a goal in itself, since it makes it very hard to apply patches to already modified code.<br />
These include src/nexj/core/scripting/GenericParser.java and /core/test/nexj/core/integration/format/xml/XMLMessageParserTest.java<br />
<br />
<br />
=====GenericParser.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Please undo (I have found only trivial space-removal changes)<br />
|Complete<br />
|}<br />
<br />
<br />
=====XML_FormatString.message, XMLMessageParserTest.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Why have these been changed? Please undo.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONWriter.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Please undo all the method renaming - this breaks a number of classes in the enterprise project, and was not needed in the first place.<br />
Trivial code modifications are discouraged, since they tend to complicate merges and sometimes, like in this case, even break code.<br />
|Complete<br />
|-<br />
| Remove TOKEN_END_OBJECT and TOKEN_END_ARRAY public constants.<br />
The object and array should be closed by invoking a corresponding method on JSONWriter.<br />
Having these constants exposes implementation details and breaks any attempts to subclass this class.<br />
|Complete<br />
|-<br />
|Remove writeBoolean(Boolean). It will break if the value is null, and is not really needed. Invoke writeBoolean(boolean) instead.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMarshaller.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Undo the trivial method renaming<br />
|Complete<br />
|}<br />
<br />
<br />
=====baseTypes.xsd=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Array is JSON - leave only one space after JSON<br />
|Complete<br />
|-<br />
|Node -> message part<br />
|Complete<br />
|-<br />
|'It is also called "typed array".' -> remove this phrase<br />
|Complete<br />
|-<br />
|typed array -> root. Put this after the array.<br />
|Complete<br />
|-<br />
|mode -> subtype<br />
|Complete<br />
|-<br />
|Use an enum instead of an integer for mode, this is far more developer friendly, and does not need a coding table: e.g. subtype="array|root". The subtype should be empty by default.<br />
|Complete<br />
|-<br />
| We should have a "name" attribute for mapping object part keys, as well as subtypes for dates and binary values, like in the XML formatter<br />
|Complete<br />
|}<br />
<br />
<br />
=====en.strings=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| err.integration.json.parse.binary.expectedString=Error parsing binary for "{0}", was expecting a string value but found\: {1}. <br/><br />
-> err.integration.json.parse.binary=Invalid binary value for message part "{0}" (expected a string).<br />
|Complete<br />
|-<br />
|Do not include actual data values in error messages, for privacy reasons. <br/><br />
err.integration.json.parse.binary.invalidBase64=Invalid base64 format for message part "{0}". <br/><br />
-> err.integration.json.parse.base64=Invalid base64 value for message part "{0}".<br />
|Complete<br />
|-<br />
|*err.integration.json.parse.duplicateKey=Found duplicate key\: "{0}". <br/><br />
-> err.integration.json.parse.duplicateKey=Duplicate object key\: "{0}". <br />
*Can you include the message part path in the message? <br />
|Complete<br />
|-<br />
|err.integration.json.parse.oidExpectedString=Error parsing OID for "{0}", was expecting a string value but found\: {1}.<br/><br />
-> err.integration.json.parse.oid =Invalid OID for message part "{0}" (expected a string).<br />
|Complete<br />
|-<br />
|err.integration.json.parse.oidInvalidBase64=Error parsing OID for "{0}", invalid base64 format at\: Line "{1}", Column "{2}". <br/><br />
-> err.integration.json.parse.base64= Invalid base64 value for message part "{0}".<br />
|Complete<br />
|-<br />
| err.integration.json.parse.primitiveTypeMismatch=Error parsing "{0}", was expecting a {1} value but found\: {2}. <br/><br />
-> err.integration.json.parse.typeMismatch=Type mismatch in message part "{0}" (expected a "{1}").<br />
|Complete<br />
|-<br />
|err.integration.json.parse.requiredValueNull=Error parsing "{0}", required part cannot be "null". <br/><br />
-> err.integration.json.parse.requiredNull=Required message part "{0}" is null.<br />
|Complete<br />
|-<br />
|err.integration.json.parse.timestamp=Error parsing timestamp for "{0}", was expecting a number value but found\: {1}. <br/><br />
-> err.integration.json.parse.timestamp=Invalid timestamp for message part "{0}" (expected a numeric value).<br />
|Complete<br />
|-<br />
|err.integration.json.parse.unexpectedToken=Error parsing "{0}", was expecting "{1}" but found "{2}". <br/><br />
-> err.integration.json.parse.unexpectedToken=Unexpected token in message part "{0}" (expected "{1}").<br />
|Complete<br />
|-<br />
|err.meta.integration.json.anyOrdinalCannotHaveFormat=Primitive message part "{0}" of type any ordinal cannot have a format string.<br/><br />
-> err.meta.integration.json.anyFormat=Primitive message part "{0}" of type any cannot have a format pattern.<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidMessageFormatMode=Invalid message format mode "{0}" in RootJSONMessagePartMapping for "{1}". <br/><br />
-> err.meta.integration.json.invalidSubtype=Invalid subtype "{0}" in the mapping of message part "{1}".<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidTypedArray.notCollection=Typed array message {0} child part must be a collection. <br/><br />
-> no, not really. Remove.<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidTypedArray.notOnePart=Typed array message {0} may only have one child part. <br/><br />
-> err.meta.integration.json.rootChild =Root message part "{0}" must have exactly one child part.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessagePartMapping.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|move m_sFormat, m_bQuote up, into the // attributes section - this is a coding convention<br />
|Complete<br />
|-<br />
|m_bQuote -> m_bQuoted<br />
|Complete<br />
|-<br />
|ToBeQuoted -> Quoted<br />
|Compelte<br />
|-<br />
|Group setter and getters together logically, in the beginning of the operations: setter1 getter1 setter2 getter2... <br/><br />
Having the operations grouped alphabetically makes it hard to read the code.<br />
|Complete<br />
|}<br />
<br />
<br />
=====RootJSONMessagePartMapping.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| RootJSONMessagePartMapping -> CompositeJSONMessagePartMapping (since it is not just for the root message part, right?)<br />
|Complete<br />
|-<br />
|m_nMessageFormat -> m_nSubtype<br />
|Complete<br />
|-<br />
|Defaults to {@link RootJSONMessagePartMapping#FORMAT_OBJECT}. - remove the comment and assign the actual value instead.<br />
|Complete<br />
|-<br />
|static final -> final static (convention)<br />
|Complete<br />
|-<br />
|FORMAT_ -> SUBTYPE_<br />
|Complete<br />
|-<br />
|FORMAT_TYPED_ARRAY -> SUBTYPE_ROOT = 2<br />
|Complete<br />
|-<br />
|Move constants up, before the attributes<br />
|Complete<br />
|-<br />
|MessageFormatMode -> Subtype; The validation is not needed, since it will be validated in the loader when parsing the symbol value.<br />
|Complete<br />
|}<br />
<br />
<br />
=====XMLJSONMessageMappingLoader.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|<code>throw new MetadataException("err.meta.integration.json.anyOrdinalCannotHaveFormat", new Object[]{part.getFullPath()});</code><br />
*Try to do this validation in the mapping instead<br />
*The same applies to the format validation and the business logic for setting the quoted flag - move to the mapping<br />
|Complete<br />
|-<br />
|<br />
<code>if (!"true".equals(sFormat) || !"false".equals(sFormat))</code> <br />
-> this always evaluates to true - please fix the logic. <br/><br />
A format that is just "true" or just "false" seems uncommon though. Did you mean "true;false"?<br />
|Compelte<br />
|-<br />
|All regexp pattern should be precompiled in final static constants.<br />
|Complete<br />
|}<br />
<br />
=====JSONMessageFormatter.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|We should format or parse message part without OIDs and circular refs. <br/><br />
The integration engine is designed to deal with hierarchical messages and circular ones can get it into faulty code paths. <br/><br />
It is supposed to support only the most basic conventions and not output or expect messages that require special handling from the external system. <br/><br />
This is needed to facilitate easy integration. Circular refs and OIDs are used in our RPC marshaller, but the goals of the integration engine are quire different. <br/><br />
|Complete<br />
|-<br />
| m_objectMap - not needed anymore<br />
|Complete<br />
|-<br />
|formatCompositeMessagePart - instead of using nChar, invoke the corresponding writer output methods.<br />
|Complete<br />
|-<br />
|Remove the OID management code<br />
|Complete<br />
|-<br />
| Add code for handling the primitive subtypes (hex, base64, dateTime, date, time)<br />
|Complete<br />
|-<br />
|<code>|| ((nMinCount == nMaxCount) && (nCount != nMinCount))</code> this condition is invalid and will produce an incorrect error message<br />
|Complete<br />
|-<br />
|Do not use j as a counter. Use k instead. j looks like i under many fonts.<br />
|Complete<br />
|-<br />
|writePrimitive - use a switch for nPartType, rather than several if statements.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessageParser.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|m_objectMap - not needed anymore<br />
|Complete<br />
|-<br />
|The overridden methods, like parseObject(), parseElement(), parseArray() etc have a very similar logic to the superclass methods. To avoid duplication, it is better to handle any custom logic needed in these with template methods, like constructing a TransferObject instead of a hashtab e.g. Object createObject(), addObjectValue(Object obj, String sKey, Object value), createArray(), Object addArrayValue(Object array, Object value). <br/><br />
The overriden methods parse* will save and restore the current message part and will check if the structure they parse corresponds to the current message part type and mapping. <br/><br />
This should not introduce a dependency on the integration classes in JSONParser. <br/><br />
Keep the template methods simple. <br/><br />
Alternatively, do not override the base class parse* methods, but just convert the parsing results to transfer objects on a second pass (this can help with message tables, see below).<br />
|Complete (Implemented a hybrid, message table parsing uses a second pass, while direct parsing uses overridden methods)<br />
|-<br />
|It should be possible to parse a primitive message, e.g. 1 or "abc". The mapping for this has subtype="root" and the only message part corresponds to this primitive type.<br />
|Complete<br />
|-<br />
|parsePartValue - m_currentMessagePart .isCollection() - remove the space<br />
|Complete<br />
|- <br />
|initializeMessageTable - it is possible to support more than one message with an object subtype. The mapping can support an additional property key="<key>:<value>", designating a key and a value, which must establish a unique combination for identifying the message in the table. This way we can have also message polymorphism (later phase?).<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessageTest.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| FORMART -> FORMAT<br />
|Complete<br />
|}</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter_Code_Review_3_Changes&diff=80568JSON Integration Adapter Code Review 3 Changes2012-02-04T16:12:49Z<p>Gbatumbya: Created page with 'category: NexJ Express JSON Message Adapter ===== General ===== The most important changes are: * Changing the terminology and the mapping property type around the mapping m…'</p>
<hr />
<div>[[category: NexJ Express JSON Message Adapter]]<br />
<br />
===== General =====<br />
The most important changes are:<br />
* Changing the terminology and the mapping property type around the mapping modes.<br />
* Removing the circular ref and OID support, since they do not make sense for the integration engine.<br />
* Refactoring of the message parser to remove the duplicated parsing logic (there are two possible approaches with this)<br />
*Spaces generally must not be removed from existing files, as a trivial change and a goal in itself, since it makes it very hard to apply patches to already modified code.<br />
These include src/nexj/core/scripting/GenericParser.java and /core/test/nexj/core/integration/format/xml/XMLMessageParserTest.java<br />
<br />
<br />
=====GenericParser.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Please undo (I have found only trivial space-removal changes)<br />
|Complete<br />
|}<br />
<br />
<br />
=====XML_FormatString.message, XMLMessageParserTest.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Why have these been changed? Please undo.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONWriter.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Please undo all the method renaming - this breaks a number of classes in the enterprise project, and was not needed in the first place.<br />
Trivial code modifications are discouraged, since they tend to complicate merges and sometimes, like in this case, even break code.<br />
|Complete<br />
|-<br />
| Remove TOKEN_END_OBJECT and TOKEN_END_ARRAY public constants.<br />
The object and array should be closed by invoking a corresponding method on JSONWriter.<br />
Having these constants exposes implementation details and breaks any attempts to subclass this class.<br />
|Complete<br />
|-<br />
|Remove writeBoolean(Boolean). It will break if the value is null, and is not really needed. Invoke writeBoolean(boolean) instead.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMarshaller.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Undo the trivial method renaming<br />
|Complete<br />
|}<br />
<br />
<br />
=====baseTypes.xsd=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| Array is JSON - leave only one space after JSON<br />
|Complete<br />
|-<br />
|Node -> message part<br />
|Complete<br />
|-<br />
|'It is also called "typed array".' -> remove this phrase<br />
|Complete<br />
|-<br />
|typed array -> root. Put this after the array.<br />
|Complete<br />
|-<br />
|mode -> subtype<br />
|Complete<br />
|-<br />
|Use an enum instead of an integer for mode, this is far more developer friendly, and does not need a coding table: e.g. subtype="array|root". The subtype should be empty by default.<br />
|Complete<br />
|-<br />
| We should have a "name" attribute for mapping object part keys, as well as subtypes for dates and binary values, like in the XML formatter<br />
|Complete<br />
|}<br />
<br />
<br />
=====en.strings=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| err.integration.json.parse.binary.expectedString=Error parsing binary for "{0}", was expecting a string value but found\: {1}. <br/><br />
-> err.integration.json.parse.binary=Invalid binary value for message part "{0}" (expected a string).<br />
|Complete<br />
|-<br />
|Do not include actual data values in error messages, for privacy reasons. <br/><br />
err.integration.json.parse.binary.invalidBase64=Invalid base64 format for message part "{0}". <br/><br />
-> err.integration.json.parse.base64=Invalid base64 value for message part "{0}".<br />
|Complete<br />
|-<br />
|*err.integration.json.parse.duplicateKey=Found duplicate key\: "{0}". <br/><br />
-> err.integration.json.parse.duplicateKey=Duplicate object key\: "{0}". <br />
*Can you include the message part path in the message? <br />
|Complete<br />
|-<br />
|err.integration.json.parse.oidExpectedString=Error parsing OID for "{0}", was expecting a string value but found\: {1}.<br/><br />
-> err.integration.json.parse.oid =Invalid OID for message part "{0}" (expected a string).<br />
|Complete<br />
|-<br />
|err.integration.json.parse.oidInvalidBase64=Error parsing OID for "{0}", invalid base64 format at\: Line "{1}", Column "{2}". <br/><br />
-> err.integration.json.parse.base64= Invalid base64 value for message part "{0}".<br />
|Complete<br />
|-<br />
| err.integration.json.parse.primitiveTypeMismatch=Error parsing "{0}", was expecting a {1} value but found\: {2}. <br/><br />
-> err.integration.json.parse.typeMismatch=Type mismatch in message part "{0}" (expected a "{1}").<br />
|Complete<br />
|-<br />
|err.integration.json.parse.requiredValueNull=Error parsing "{0}", required part cannot be "null". <br/><br />
-> err.integration.json.parse.requiredNull=Required message part "{0}" is null.<br />
|Complete<br />
|-<br />
|err.integration.json.parse.timestamp=Error parsing timestamp for "{0}", was expecting a number value but found\: {1}. <br/><br />
-> err.integration.json.parse.timestamp=Invalid timestamp for message part "{0}" (expected a numeric value).<br />
|Complete<br />
|-<br />
|err.integration.json.parse.unexpectedToken=Error parsing "{0}", was expecting "{1}" but found "{2}". <br/><br />
-> err.integration.json.parse.unexpectedToken=Unexpected token in message part "{0}" (expected "{1}").<br />
|Complete<br />
|-<br />
|err.meta.integration.json.anyOrdinalCannotHaveFormat=Primitive message part "{0}" of type any ordinal cannot have a format string.<br/><br />
-> err.meta.integration.json.anyFormat=Primitive message part "{0}" of type any cannot have a format pattern.<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidMessageFormatMode=Invalid message format mode "{0}" in RootJSONMessagePartMapping for "{1}". <br/><br />
-> err.meta.integration.json.invalidSubtype=Invalid subtype "{0}" in the mapping of message part "{1}".<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidTypedArray.notCollection=Typed array message {0} child part must be a collection. <br/><br />
-> no, not really. Remove.<br />
|Complete<br />
|-<br />
|err.meta.integration.json.invalidTypedArray.notOnePart=Typed array message {0} may only have one child part. <br/><br />
-> err.meta.integration.json.rootChild =Root message part "{0}" must have exactly one child part.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessagePartMapping.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|move m_sFormat, m_bQuote up, into the // attributes section - this is a coding convention<br />
|Complete<br />
|-<br />
|m_bQuote -> m_bQuoted<br />
|Complete<br />
|-<br />
|ToBeQuoted -> Quoted<br />
|Compelte<br />
|-<br />
|Group setter and getters together logically, in the beginning of the operations: setter1 getter1 setter2 getter2... <br/><br />
Having the operations grouped alphabetically makes it hard to read the code.<br />
|Complete<br />
|}<br />
<br />
<br />
=====RootJSONMessagePartMapping.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| RootJSONMessagePartMapping -> CompositeJSONMessagePartMapping (since it is not just for the root message part, right?)<br />
|Complete<br />
|-<br />
|m_nMessageFormat -> m_nSubtype<br />
|Complete<br />
|-<br />
|Defaults to {@link RootJSONMessagePartMapping#FORMAT_OBJECT}. - remove the comment and assign the actual value instead.<br />
|Complete<br />
|-<br />
|static final -> final static (convention)<br />
|Complete<br />
|-<br />
|FORMAT_ -> SUBTYPE_<br />
|Complete<br />
|-<br />
|FORMAT_TYPED_ARRAY -> SUBTYPE_ROOT = 2<br />
|Complete<br />
|-<br />
|Move constants up, before the attributes<br />
|Complete<br />
|-<br />
|MessageFormatMode -> Subtype; The validation is not needed, since it will be validated in the loader when parsing the symbol value.<br />
|Complete<br />
|}<br />
<br />
<br />
=====XMLJSONMessageMappingLoader.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|<code>throw new MetadataException("err.meta.integration.json.anyOrdinalCannotHaveFormat", new Object[]{part.getFullPath()});</code><br />
*Try to do this validation in the mapping instead<br />
*The same applies to the format validation and the business logic for setting the quoted flag - move to the mapping<br />
|Complete<br />
|-<br />
|<code>if (!"true".equals(sFormat) || !"false".equals(sFormat))</code> <br />
-> this always evaluates to true - please fix the logic. <br/><br />
A format that is just "true" or just "false" seems uncommon though. Did you mean "true;false"?<br />
|Compelte<br />
|-<br />
|All regexp pattern should be precompiled in final static constants.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessageFormatter.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|We should format or parse message part without OIDs and circular refs. <br/><br />
The integration engine is designed to deal with hierarchical messages and circular ones can get it into faulty code paths. <br/><br />
It is supposed to support only the most basic conventions and not output or expect messages that require special handling from the external system. <br/><br />
This is needed to facilitate easy integration. Circular refs and OIDs are used in our RPC marshaller, but the goals of the integration engine are quire different. <br/><br />
|Complete<br />
|-<br />
| m_objectMap - not needed anymore<br />
|Complete<br />
|-<br />
|formatCompositeMessagePart - instead of using nChar, invoke the corresponding writer output methods.<br />
|Complete<br />
|-<br />
|Remove the OID management code<br />
|Complete<br />
|-<br />
| Add code for handling the primitive subtypes (hex, base64, dateTime, date, time)<br />
|Complete<br />
|-<br />
|<code>|| ((nMinCount == nMaxCount) && (nCount != nMinCount))</code> this condition is invalid and will produce an incorrect error message<br />
|Complete<br />
|-<br />
|Do not use j as a counter. Use k instead. j looks like i under many fonts.<br />
|Complete<br />
|-<br />
|writePrimitive - use a switch for nPartType, rather than several if statements.<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessageParser.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|m_objectMap - not needed anymore<br />
|Complete<br />
|-<br />
|The overridden methods, like parseObject(), parseElement(), parseArray() etc have a very similar logic to the superclass methods. To avoid duplication, it is better to handle any custom logic needed in these with template methods, like constructing a TransferObject instead of a hashtab e.g. Object createObject(), addObjectValue(Object obj, String sKey, Object value), createArray(), Object addArrayValue(Object array, Object value). <br/><br />
The overriden methods parse* will save and restore the current message part and will check if the structure they parse corresponds to the current message part type and mapping. <br/><br />
This should not introduce a dependency on the integration classes in JSONParser. <br/><br />
Keep the template methods simple. <br/><br />
Alternatively, do not override the base class parse* methods, but just convert the parsing results to transfer objects on a second pass (this can help with message tables, see below).<br />
|Complete (Implemented a hybrid, message table parsing uses a second pass, while direct parsing uses overridden methods)<br />
|-<br />
|It should be possible to parse a primitive message, e.g. 1 or "abc". The mapping for this has subtype="root" and the only message part corresponds to this primitive type.<br />
|Complete<br />
|-<br />
|parsePartValue - m_currentMessagePart .isCollection() - remove the space<br />
|Complete<br />
|- <br />
|initializeMessageTable - it is possible to support more than one message with an object subtype. The mapping can support an additional property key="<key>:<value>", designating a key and a value, which must establish a unique combination for identifying the message in the table. This way we can have also message polymorphism (later phase?).<br />
|Complete<br />
|}<br />
<br />
<br />
=====JSONMessageTest.java=====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
| FORMART -> FORMAT<br />
|Complete<br />
|}</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter_Code_Review_2_Changes&diff=80567JSON Integration Adapter Code Review 2 Changes2012-02-04T15:27:31Z<p>Gbatumbya: Created page with 'category: NexJ Express JSON Message Adapter ====JSONMessageFormatter==== {| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collaps…'</p>
<hr />
<div>[[category: NexJ Express JSON Message Adapter]]<br />
<br />
====JSONMessageFormatter====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Line 35 <br/><br />
// attributes Should be // associations<br />
|Compelete<br />
|-<br />
|Line 40 <br/><br />
Move s_logger (final static members) to right before // operations<br />
|Complete<br />
|-<br />
|Line 244 <br/><br />
<code>if (!innerPart.isCollection() || (bArrayElement && innerPart.isCollection()))</code><br />
should be<br />
<code>if (!innerPart.isCollection() || bArrayElement)</code><br />
|Complete<br />
|-<br />
|Line 250, 265, 311 <br/><br />
You shouldn’t have to catch ClassCastExceptions. You should catch all Exceptions at the top level and wrap them in an Integration exception with the cause exception contained.<br />
Like this:<br />
<code><br />
catch (IntegrationException e)<br />
{<br />
throw e;<br />
}<br />
catch (Exception e)<br />
{<br />
throw new IntegrationException("err.integration.format",<br />
new Object[]{message.getName()}, e);<br />
}<br />
</code><br />
|Complete<br />
|-<br />
|Line 369 Remove it<br />
|Complete<br />
|}<br />
<br />
====JSONMessageParser====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Line 297, 338 <br/><br />
In method parseObjectArray m_nListDepth is decremented, but never incremented. Is this a bug?<br />
|Complete<br />
|-<br />
|Line 366<br/><br />
parseValue(messagePart) is always called with m_currentMessagePart so you don’t need the argument.<br />
|Complete<br />
|-<br />
|Line 409, 443<br/><br />
In method parseArray m_nListDepth is decremented, but never incremented. Is this a bug?<br />
|Complete<br />
|-<br />
|Line 502 <br/><br />
Move to Line 506 – it’s not faster<br />
|Complete<br />
|}<br />
<br />
====RootJSONMessagePartMapping====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Line 50, 75<br/><br />
|Part instanceof PrimitiveMessagePart should never be true here. You can assert that it isn’t.<br/><br />
To make sure that it isn’t iterate over child parts, get their mapping and call finish on the mapping.<br />
|Complete<br />
|}<br />
<br />
<br />
====RootJSONMessagePartMapping====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Line 31<br/><br />
*FORMAT_DEFAULT should be FORMAT_OBJECT<br />
*You can mention it’s the default in the documentation (javadoc/xsd).<br />
|Complete<br />
|}<br />
<br />
<br />
====JSONParser====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Line 71 <br/><br />
*Method parse is overridden for no reason.<br />
|Complete<br />
|}<br />
<br />
<br />
====JSONWriter====<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
! Tasks<br />
! Status<br />
|-<br />
|Line 53, 76 <br/><br />
Instead of having getEndObject and getEndArray methods create public static constants for these characters and use them everywhere.<br />
|Complete<br />
|}</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=80566SQLite Adapter StandUp Reports2012-02-04T15:16:07Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
=Week 9: Mar 5=<br />
=Week 8: Feb 27=<br />
=Week 7: Feb 20=<br />
=Week 6: Feb 13=<br />
=Week 5: Feb 6=<br />
--><br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Implementing toBinary sqlite c function<br />
* Review debugging with Teee in studio<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* OS architecture and platform extension loading<br />
* Prepping for NexJ meeting<br />
* completing and compiling NexJFunctions extension<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"<br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80565JSON Integration Adapter2012-02-04T14:44:15Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
*Completed<br />
<br />
<br />
== Definitions ==<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
Phase 6. Apply Changes from Code Review 1<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
# Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80564JSON Integration Adapter2012-02-04T14:43:45Z<p>Gbatumbya: </p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
*Completed<br />
<br />
<br />
=== Definitions ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
<br />
==Project Phases==<br />
Phase 6. Apply Changes from Code Review 1<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
# Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=JSON_Integration_Adapter&diff=80563JSON Integration Adapter2012-02-04T14:40:02Z<p>Gbatumbya: /* Current Status */</p>
<hr />
<div>[[category: NexJ Current Projects]]<br />
[[category: NexJ Express JSON Message Adapter]]<br />
== Project Goal==<br />
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format<br />
<br />
Contributors<br />
* [[User:Gbatumbya|Grace Batumbya]]<br />
* [[User:Brianlim | Brian Lim]]<br />
<br />
<br />
== Current Status==<br />
*Completed<br />
<br />
==Project Phases==<br />
Phase 6. Apply Changes from Code Review 1<br />
<br />
===Phase 1. Research (DONE)===<br />
# Complete Fundamentals of NexJ Studio tutorial<br />
# Complete NexJ Integration tutorial<br />
# Install NexJ Studio Express from source<br />
<br />
===Phase 2. Design Proposal (DONE)===<br />
# Receive general approval for project<br />
# Receive approval for JSON encoding options<br />
# Receive approval for JSON formatting options<br />
# [https://docs.google.com/document/d/1wAjG-xSJi227GBPUZtADAROSydIn3KuimoZarqO7xDQ/edit?hl=en_US Final Project Proposal]<br />
<br />
===Phase 3. Create Classes (DONE)===<br />
# JSONMessagePartMapping<br />
# XMLJSONMessageMappingLoader<br />
# JSONMessageFormatter<br />
# JSONMessageParser<br />
# JSONMessageFormatterTest<br />
<br />
===Phase 4. Internal Code Review (DONE)===<br />
# Internally review code at CDOT<br />
<br />
===Phase 5. Code Review 1 (DONE)===<br />
# August 9, 2011<br />
# Code review took place at NexJ with [[User:Gbatumbya|Grace Batumbya]], [[User:Brianlim | Brian Lim]] and Andrew Borzenko (NexJ Developer) in attendance.<br />
<br />
===Phase 6. Apply Changes from Code Review 1===<br />
# Estimated Duration: 3 Weeks (August 29, 2011)<br />
# [[JSON_Integration_Adapter_Code_Review_1_Changes | Changes to make]]<br />
'''Summary of [[JSON_Integration_Adapter_Code_Review_1_Changes | changes]]'''<br />
# Allowing modes for all Composite message parts, not just the root.<br />
# Refactoring methods to check for != right condition instead of checking for the wrong condition to throw an exception. (whitelist instead of blacklist)<br />
# Formatting all primitives before writing or storing them (e.g. timestamps, decimal numbers.)<br />
# Creating a RootJSONMessagePartMapping extending JSONMessagePartMapping<br />
<br />
===Phase 7. Code Review 2===<br />
# Proposed Date: Week of <del>September 23</del> October 15<br />
<br />
== Project Repository ==<br />
BitBucket : https://bitbucket.org/gbatumbya/nexjexpress-jsonintergrationadapter/<br />
<br/>Deprecated: <del>https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/</del><br />
<br />
<br />
=== Definitions ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Term<br />
! Description<br />
|-<br />
| Formatter<br />
| Turns data into JSON<br />
|-<br />
| Parser<br />
| Turns JSON into data<br />
|-<br />
| Message<br />
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.<br />
|-<br />
| MessageInstance<br />
| The information to be parsed or formatted<br />
|}<br />
<br />
Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model. <br />
<br />
* Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.<br />
<br />
* Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.<br />
<br />
<br />
==== Message Fundamentals ====<br />
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.<br />
<br />
[[File:NexJExpressMessages.gif|NexJ Express Messages]]<br />
<br />
Internally, messages are Transfer Objects. To determine if a node is a message, use instanceof on CompositeMessagePartInstance after retrieving the MessagePart. For example,<br />
<br />
<pre><br />
public void format(TransferObject tobj, Message message, Output out) throws IntegrationException<br />
{<br />
...<br />
CompositeMessagePart root = message.getRoot(); // Gets the root of the message.<br />
Iterator it = root.getPartIterator();<br />
while (it.hasNext())<br />
{<br />
part = (MessagePart)it.next());<br />
if (part instanceof CompositeMessagePartInstance)<br />
{<br />
// This part is a message<br />
}<br />
else if (part instanceof PrimitiveMessagePart)<br />
{<br />
// This part is a value<br />
}<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
NOTE: THE MESSAGE PARAMETER DOES NOT CONTAIN THE MESSAGE VALUES. THE MESSAGE PARAMETER CONTAINS THE MESSAGE METADATA. THE TRANSFER OBJECT CONTAINS THE MESSAGE VALUES WHICH MUST BE VALIDATED AGAINST THE MESSAGE TO ENSURE CORRECT FORMAT.<br />
<br />
; MessagePart<br />
:Parts of a message. Messages can contain values or other messages. NexJ Express has two types of message parts, ''CompositeMessagePart'' and ''PrimitiveMessagePart''.<br />
<br />
; CompositeMessagePart<br />
: implementation is CompositeMessagePartInstance . The relationship between CompositeMessagePartInstance and PrimitiveMessagePart with the above picture is as follows - CompositeMessagePartInstance are messages (the red nodes) and PrimitiveMessagePart are values (the green nodes). To determine multiplicity of MessageParts, use isCollection() method of MessagePart. Note that multiplicity of the above screenshot are all '''[0..1]''', that is zero or one instance. Possible node multiplicities:<br />
; '''[0..1]''' : zero or one instance (i.e. an optional entry)<br />
; '''[1..1]''' : exactly one instance (i.e. required)<br />
; '''[1..N]''' : collection of at least one, at most N instances<br />
; '''[0..0]''' : collection of zero to infinite instances (displayed as '''[*]''')<br />
; '''[1..0]''' : collection of at least one, possibly unlimited instances<br />
<br />
; XMLJSONMessageMappingLoader<br />
: Used by the framework to autoload JSONMessagePartMapping for each of the message parts.<br />
<br />
; JSONMessagePartMapping<br />
: Each node in the above picture ''may'' has a corresponding JSONMessagePartMapping. Each node may have its own mapping, with its own values initialized in XMLJSONMessageMappingLoader. In order to get the mapping, first cast MessagePart to a concrete class such as CompositeMessagePartInstance or PrimitiveMessagePart, then use part.getMapping(). The purpose of the mapping is metadata for each node.<br />
<br />
; JSONMessageFormatter<br />
: Used to turn messages into JSON format.<br />
<br />
; JSONMessageParser<br />
: Used to turn JSON into a message.<br />
<br />
==== Algorithm ====<br />
<br />
format(TransferObject tobj, Message message, Output out)<br />
Algorithm for format method is as follows<br />
# Retrieve the root of the message<br />
# Iterate through each of the parts of the root<br />
## If the part is a CompositeMessagePartInstance, it is a message node<br />
## If the part is a PrimitiveMessagePart, it is a value node<br />
## Validate the part against the MessagePartMapping. Different types of validation must be done if the part is a Composite versus if it is a Primitive.<br />
## If the part is a CompositeMessagePartInstance, recursively call the format method with TransferObject set to the part. Suggested to overload the format method to format(TransferObject tobj, MessagePart message, Output out) and pass in the part, since retrieving a message root with getRoot() will always get the highest root of the message but what you want is the parent.<br />
## If the part is a PrimitiveMessagePart, write the message part to the output.<br />
<br />
== Resources ==<br />
JSON RFC : http://www.ietf.org/rfc/rfc4627.txt<br /><br />
Introduction to NexJ Studio Express : https://www.projects.openhealthtools.org/sf/go/doc1771?nav=1<br /><br />
NexJ Developer's Guide<br /><br />
NexJ Integration Fundamentals<br /><br />
Open Health Tools Integration Platform https://www.projects.openhealthtools.org/sf/projects/oht_aip/<br /></div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=Meeting_Room_T1042&diff=80522Meeting Room T10422012-02-03T15:26:12Z<p>Gbatumbya: </p>
<hr />
<div>Meeting room T1042 is a small conference room that can be booked via this page for any meeting related to Open Source. Please do not book this room for <span class="plainlinks">[http://www.andrewflusche.com/services/virginia-reckless-driving-ticket-defense/<span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">Virginia reckless driving</span>] extended periods (more than 2 hours) for other groups without checking with CDOT staff.<br />
<br />
Room facilities:<br />
* Conference table, 6 seats, power (under table)<br />
* Flipchart/whiteboard<br />
* LCD monitor with HDMI/DVD-D/VGA inputs - 1080x1920 (1080p)<br />
* Wired DHCP ethernet port<br />
<br />
Telephone information:<br />
* Phone number for dial-in: 416-491-5050 ext 33421<br />
* Telephone has basic speakerphone capability<br />
* For dial-out, press 9 <br />
<br />
This room is booked via this web page. To add a booking, please add a row to this table; you'll need to login (or create an account) to edit. You can sort this table using the icons beside the column <span class="plainlinks">[http://www.phuketproperty.com/<span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">Phuket property</span>] headers.<br />
<br />
{{Admon/caution|Unsorted Data!|Rows will not be in chronological order until you sort them. Please sort by clicking on the arrow icon before adding to the table, in order to avoid double-booking.}}<br />
<br />
<br />
[[Category:CDOT]]<br />
{|class="mediawiki sortable" border="2" width="100%"<br />
<br />
|-<br />
!Date and time<br />
(YYYY-MM-DD HH:MM-HH:MM)<br />
!Purpose<br />
!Contact person<br />
<!-- To add a new row, copy and paste the following text and fill it in: ************<br />
|-<br />
|YYYY-MM-DD HH:MM-HH:MM<br />
|Purpose<br />
|Contact person<br />
<br />
Please remember to REPLACE the date, Purpose, and Contact, but to leave the pipe characters "|"<br />
Feel free to delete old bookings.<br />
<br />
TIMES MUST BE IN 24-HOUR FORMAT WITH 2-DIGIT HOURS TO SORT PROPERLY.<br />
<br />
Paste new bookings below this line. ********************************************** -->|-<br />
|-<br />
|2012-02-03 15:00-16:30<br />
|SQLite Adapter Retrospective meeting<br />
|[[user:gbatumbya | Grace Batumbya]]<br />
|-<br />
|2012-02-01 15:00-16:00<br />
|Big Blue Button<br />
|Fardad Soleimanloo<br />
|-<br />
|-<br />
|2012-02-15 10:30-11:30<br />
|Exocortex Project<br />
|Dawn Mercer<br />
|-<br />
|2012-02-08 10:30-11:30<br />
|Exocortex Project<br />
|Dawn Mercer<br />
|-<br />
|2012-01-31 10:30-11:30<br />
|Exocortex Project<br />
|Dawn Mercer<br />
|-<br />
|2012-02-02 10:30-12:30<br />
|Privplay<br />
|Ian Tipson <br />
|-<br />
|2012-01-26 16:30-18:00<br />
|Privplay<br />
|Ian Tipson <br />
|-<br />
|2012-02-08 9:45-11:00<br />
|BigBlueButton Project<br />
|Dawn Mercer<br />
|-<br />
|2012-01-25 9:45-11:00<br />
|BigBlueButton Project<br />
|Dawn Mercer<br />
|-<br />
|2012-03-27 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-03-20 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-03-13 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-03-06 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-02-28 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-02-21 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-02-14 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-02-07 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-01-31 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-01-24 13:00-14:00<br />
|Dragon Genetics Game Update<br />
|Dawn Mercer<br />
|-<br />
|2012-01-23 14:00-17:00<br />
|CDOT Orientation for new employees<br />
|Dawn Mercer<br />
|-<br />
|2012-04-26 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-04-19 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-04-12 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-04-05 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-03-29 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-03-22 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-03-15 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-03-08 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-03-01 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-02-23 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-02-16 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-02-09 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-02-02 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-01-26 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-01-19 13:45-15:30<br />
|CDOT Steering Team<br />
|Dawn Mercer<br />
|-<br />
|2012-01-19 10:00-12:00<br />
|Privplay<br />
|Ian Tipson <br />
|-<br />
|2012-01-16 11:30-1:00<br />
|Meeting<br />
|Cathy<br />
|-<br />
|2012-01-10 13:00-14:00<br />
|Spongelab Meeting<br />
|[[User:Dawn Mercer]]<br />
|-<br />
|2012-01-11 10:00-10:30<br />
|BigBlueButton Meeting<br />
|[[User:Dawn Mercer]]<br />
|-<br />
|2011-12-20 10:00-16:00<br />
| Fedora ARM training<br />
|[[User:Chris Tyler|Chris Tyler]]<br />
|-<br />
|2011-12-21 13:30-15:30<br />
|Privplay<br />
|[[User:Ian.tipson|Ian Tipson]]<br />
|-<br />
|2012-01-05 10:00-12:00<br />
| Student Meetings<br />
|[[User:Paul.W|Paul Whalen]]<br />
|-<br />
|2012-01-05 12:00-5:00<br />
|Exocortex meeting<br />
|[[User:catherine.leung|Catherine Leung]]<br />
|-<br />
|2012-01-18 12:00-13:00<br />
|Fedora ARM team meeting<br />
|[[User:Chris Tyler|Chris Tyler]]<br />
|-<br />
|2012-01-18 14:00-15:30<br />
|CDOT network meeting<br />
|[[User:Chris Tyler|Chris Tyler]]<br />
|-<br />
|2012-01-24 10:30-11:30<br />
|Exocortex meeting<br />
|[[User:catherine.leung|Catherine Leung]]<br />
|-<br />
|2012-01-24 12:45-14:00<br />
|Glaidus Meeting<br />
|Andor Salga<br />
|-<br />
|2012-01-25 16:00-17:00<br />
|Fedora ARM call<br />
|[[User:Chris Tyler|Chris Tyler]]<br />
|-<br />
|2012-01-31 14:30-15:00<br />
|OPS235 Planning<br />
|[[User:Chris Tyler|Chris Tyler]]<br />
|-<br />
|2012-02-01 16:30-18:00<br />
|Moz interview for Dave Humphrey's student<br />
|Andor Salga<br />
|-<br />
|2012-02-01 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-08 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-15 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-22 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-29 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-07 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-01 16:00-16:30<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-14 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-21 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-28 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-04 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-11 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-18 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-25 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-08 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-15 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-22 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-02-29 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-07 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-14 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-21 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-03-28 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-04 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-11 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-18 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-04-25 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|2012-05-02 16:00-17:15<br />
|Global Fedora ARM Weekly Call<br />
|[[User:maxamaxim|Masihul Abed]]<br />
<br />
|-<br />
|2012-05-02 12:00-13:15<br />
|CDOT Fedora ARM Team Meeting<br />
|[[User:maxamaxim|Masihul Abed]]<br />
|-<br />
|}<br />
<br />
See [[CDOT Rooms]] for more room information.<br />
<br />
[http://www.rentalprotectionagency.com/tenant-screening.php background check]</div>Gbatumbyahttps://wiki.cdot.senecacollege.ca/w/index.php?title=SQLite_Adapter_StandUp_Reports&diff=80399SQLite Adapter StandUp Reports2012-02-02T18:46:33Z<p>Gbatumbya: /* Week 4: Jan 30 */</p>
<hr />
<div>[[category: NexJ Express SQLite]]<br />
<br />
=Overview=<br />
Stand up reports will be posted each Monday and Thursday by 12pm.<br />
<br />
<!--<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
--><br />
<br />
<!--<br />
=Week 14: Apr 9=<br />
=Week 13: Apr 2=<br />
=Week 12: Mar 26=<br />
=Week 11: Mar 19=<br />
=Week 10: Mar 12=<br />
=Week 9: Mar 5=<br />
=Week 8: Feb 27=<br />
=Week 7: Feb 20=<br />
=Week 6: Feb 13=<br />
=Week 5: Feb 6=<br />
--><br />
<br />
=Week 4: Jan 30=<br />
==Thursday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
|<br />
* Gave Carlin tutorial on debugging with Teee<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
|<br />
* Investigate UNICODE support in SQLite<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
==Monday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Reviewed code<br />
* driver make file<br />
|<br />
* Tested SQLiteAdapter with Teee<br />
* Passing the testRead unit test<br />
* Research on SQLite multi-threading<br />
* Research on nmake for building SQLite components with visual studio tools<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* Source make file<br />
* Rebuilding the sqlite library for multi-thread mode<br />
|<br />
* Research on SQLite multi-threading<br />
|<br />
|-<br />
|What is blocking me?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|-<br />
|What am I blocking (or about to block)?<br />
|<br />
n/a<br />
|<br />
n/a<br />
|<br />
|}<br />
<br />
=Week 3: Jan 23=<br />
==Thursday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Code clean up<br />
* Exploring attach database issue<br />
|<br />
* Fixed binding of Decimal values<br />
* Added support for missing type conversions cases<br />
* Repository maintenance<br />
|<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* driver make file<br />
* sqlite source make file<br />
* Investigating failing adapter tests<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
! Abhishek<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Driver make file<br />
|<br />
* Refactoring SQLiteDataSourceWrapper<br />
* Getting the adapter to load an external datasource<br />
|<br />
* Converting SQLite Rank DLL to VS project<br />
* Working on appendMatchStatement in SQLite Adapter<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Driver make file<br />
* SQLite adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|<br />
* Finishing up appendMatchStatement in SQLite Adapter<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 2: Jan 16=<br />
==Thursday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Modifying our sqlite jdbc<br />
* Including the driver inside the project<br />
|<br />
* Delegating tasks<br />
* Adding constraint names to error message for constraint violations<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Completely integrate the driver and sqlite source into the project<br />
* Software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Extension loading, SQLiteDataSourceWrapper<br />
* SQLiteDataSourceWrapper workflow<br />
* Team issues on BitBucket<br />
|<br />
n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Recompiling SQLite JDBC 3.7.10<br />
* SQLite Adapter Software Design Document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Week 1: Jan 9=<br />
==Thursday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
|<br />
* Identified the JDBC's ''Function'' limits<br />
* Demo of extension loading<br />
|<br />
* Researched on adding functionality to SQLite<br />
* Discussed design for adding functionality with NexJ<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* SQLite Adapter software design document<br />
|<br />
* Allow loading of user defined SQLite extensions<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
==Monday==<br />
{|class="mediawiki " border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
!<br />
! Carlin<br />
! Grace<br />
|-<br />
|What have I worked on since the last stand up?<br />
| n/a<br />
| n/a<br />
|-<br />
|What am I working on before the next stand up?<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|<br />
* Research on adding functionality to SQLite<br />
* Discuss design for adding functionality with NexJ<br />
|-<br />
|What is blocking me?<br />
|n/a<br />
|n/a<br />
|-<br />
|What am I blocking (or about to block)?<br />
|n/a<br />
|n/a<br />
|}<br />
<br />
<br />
=Archive=<br />
* [http://zenit.senecac.on.ca/wiki/index.php/SQLite_Adapter_StandUp_Reports_2011 2011 Reports]</div>Gbatumbya