115 Commits

Author SHA1 Message Date
Miguel Del Castillo
aa13d8fdc1
Reverted WKT coordinate parsing to first read latitude and then longitude (#877)
* Changed WKT parent object to read coordinates as lat-long

* Changed WKT unit test to receive coordinates as 'lat,long'

* Styled Custom WKT string entry textbox to align it with the Destination one

* Reordered tags for WKT entry button
2022-05-10 12:34:33 -05:00
markpet49
76bcbce9f3 Adjust test for rounding differences. 2022-04-14 14:10:27 -05:00
markpet49
d814cf50a1 Fix for tile resolution, switch to VSCode. 2022-04-12 12:04:17 -05:00
Miguel Del Castillo
154b14f594
Unit testing and dependency updates: Replace PhantomJS for Chrome and Firefox in their headless modes (#840)
* Substituted PhantomJS for headless Chromium for unit testing

* Added Firefox headless as a browser for unit testing

* Removed pupeteer dev dependency to rely on local installs of Chrome and Firefox. Temporarily commented out tests that now fail.

* Eliminated superfluous newline from karma.conf.js

* remove whitespace

* Updated npm packages related to tasking and unit testing to latest versions

* Updated grunt-jsdoc to latest version

* Removed unused 'dependencies' bracket from package.json

* Updated npm packages

* Updated es6-promise to 4.2.8 and libtess to 1.2.2

* Updated jszip to 3.2.2 and proj4-src to 2.6.0
2021-06-16 16:03:30 -05:00
markpet49
e00acceb15 Attempted workaround for unit test anomalies 2020-09-18 13:31:14 -05:00
markpet49
00aed52527 Cleaned up version of collada pickray intersection code. 2020-09-16 18:52:35 -05:00
Mark Peterson
07db0fcc0a
License update (#830) 2020-08-12 17:28:51 -05:00
Mark Peterson
9e685202e8
Collada enhancement for lighting models with incorrect normal data. (#827)
* Pre-alpha collada normal fix

* Cleanup

* Cleanup

* Bug fixes and unit tests
2020-07-10 12:41:25 -05:00
David Collins
6bf7ad3cf8
Update WebWorldWind build dependencies (#804)
Updated the WebWorldWind npm project's build dependencies to ensure compatibility with the latest version of Node.js, Grunt, Karma, and Jasmine.

While changes like this are always worthwhile, I'm making it now to ensure that the original WebWorldWind source and its accompanying npm project will continue to operate for as long as possible after the [WorldWind project's suspension on April 5, 2019](https://worldwind.arc.nasa.gov/news/2019-03-08-suspension-notice).  Secondary goals are eliminating all npm audit warnings from old versions of libraries used to build WebWorldWind (i.e. the devDependencies) and ensuring that unit tests continue to operate.

Summary of changes:

- WebWorldWind now builds with Node.js 10.15.3 LTS and 11.12.0. The README file and the Travis CI configuration file reflect that.

- All npm devDependencies, used for building the WorldWind project, are updated to the latest version available as of this pull request.

- All npm security audit vulnerabilities are addressed.

- Subtle errors in unit tests fixed. WorldWind's geometric unit tests erroneously modified global variables, such as Location.ZERO. These values shouldn't be encoded as global variables, but solving that is out of scope here. Previous versions of Jasmine concealed this problem but these unit tests fail with Jasmine 3.x, likely due to a change in the Jasmine interpreter lifecycle between tests.
2019-03-26 12:01:56 -07:00
AkeluX
c6a8771432 Set correct coordinates order in WKT tests 2018-07-27 17:26:38 +02:00
Jakub Balhar
971695b581 Expose internal KML classes in the WorldWind namespace (#759) 2018-06-29 15:48:04 +02:00
Patrick Hogan
09c81f862e Update 2018-06-21 19:03:59 -07:00
Patrick Hogan
44a32a6501 Update 2018-06-21 18:45:33 -07:00
strikerM
a817f9a5c8 Add a reader for AAIGrid (#660) 2018-06-15 15:05:43 +02:00
David Collins
c005bc998f
Enhanced geographic to Cartesian arithmetic precision (#714)
* Unit tests for map projection arithmetic
- Unit tests for Globe's ellipsoidal properties and methods against official WGS84 reference values
- In-progress unit tests for ProjectionWGS84's geographic-to-cartesian arithmetic

* Unit tests for map projection arithmetic
- Unit tests for Globe's ellipsoidal properties and methods
- Unit tests for ProjectionWGS84's geographic-to-Cartesian transformations
- Employed official WGS84 reference values for all unit tests

* Unit tests for map projection arithmetic
- Unit tests for Globe's ellipsoidal properties and methods
- Unit tests for ProjectionWGS84's geographic-to-Cartesian transformations
- Employed official WGS84 reference values for all unit tests

* Enhanced geographic to Cartesian arithmetic precision

* Disabled unit tests validating incorrect results
- Several unit tests validated functions based on earlier output from the function itself.
- These functions computed incorrect results, and once repaired the erroneous unit tests failed.
- I've opted to disable these unit tests until an independent validation method can be established.
- In the meantime, I have added unit tests for the problematic low-level functions that are validated against independent results.

* Simplified WorldWind module import for new unit tests

* Clarified property docs for Globe.polarRadius and eccentricitySquared
2018-05-24 15:20:59 -07:00
Zach Glueckert
54900f8bb7 Add TileMatrix/TileMatrixSet (#693)
* Add a generic TileMatrix and TileMatrixSet structure

* Add comments and errors

* Add logging messages, refactor functions, synchronize naming with WWA

* Add unit tests and correct errors
2018-05-17 14:04:46 -07:00
Mark Peterson
da870bf362 Prioritized elevation coverage selection (#641) 2018-05-04 10:58:03 -07:00
David Collins
a793551329 Modified how ElevationCoverage.elevationsForGrid interprets resolution (#656)
* Modified how ElevationCoverage.elevationsForGrid interprets resolution

The function elevationsForGrid derived from the original ElevationModel, which used targetResolution to select a level in the model's tile pyramid. Since implementing composable elevations (#575), this function appears in both ElevationModel and ElevationCoverage, but serves a different purpose in each. Given that, the argument list need not be the same, and in fact should not be the same. ElevationModel needs targetResolution to let the caller influence which coverage is chosen to fulfil the request. ElevationCoverage does not need targetResolution. Allowing the caller to specify a resolution to ElevationCoverage is unnecessary and potentially dangerous. The grid itself provides an implicit resolution the coverage can use to select a level, and letting the caller override that resolution risks the caller accessing more data than can fit in memory.

Relates to #422

* Adjusted ElevationModel unit tests to reflect ElevationCoverage changes
2018-05-03 14:23:19 -05:00
Zach Glueckert
ed224f3890 Add elevation config property to WcsCoverage (#652) 2018-05-01 07:38:49 -07:00
David Collins
4ee185e952
Removed usage of TiledElevationCoverage's cachePath (#653)
- This change follows #650 to remove the usage of TiledElevationCoverage cachePath.
- Relates to #486
2018-04-30 12:54:43 -07:00
David Collins
c9d8b3d793
Simplify TiledElevationCoverage tile management (#650)
This change simplifies TiledElevationCoverage construction by removing the unnecessary cachePath configuration parameter. We could limit the scope of this change by assigning any string to cachePath and leaving TiledElevationCoverage's implementation unchanged. However, TiledElevationCoverage has significant unnecessary complexity that creates and tracks unique elevation tile keys based on the notion that cachePath is necessary. Elevation tiles and elevation images are are stored in an cache unique to each instance of TiledElevationCoverage (rather than a shared cache). Given that, there is no need to generate globally unique cache keys, which is the only purpose served by cachePath. It is enough to use Tile.tileKey, which can uniquely identify each tile in the coverage's tile cache and image cache.

This iteration removes the unnecessary ElevationTile class and replaces its usages with Tile. Additionally, this iteration removes the imagePath properties that derive from cachePath, replacing them with usage of Tile.tileKey or in-place generation of a tile key string (when a tile instance is not available). Given the size of this change, i have left cachePath intact, with the intent to remove it and its usages in the various TiledElevationCoverage implementations in the next iteration.
2018-04-30 12:29:27 -07:00
David Collins
4783c4ecf6
Refactored TiledElevationCoverage construction to support WCS (#649)
Modified TiledElevationCoverage to enable construction via configuration object. This enables loose coupling between a WebCoverageService specifying the configuration, and the scene component that consumes the configuration (TiledElevationCoverage). This is the first of several changes that streamline TiledElevationCoverage construction.

This change knowingly breaks backward compatibility. The class TiledElevationCoverage is new since 0.9.0. While we could argue that it should be possible to port 0.9.0 ElevationModel construction to TiledElevationCoverage, as the constructors currently appear very similar, they are fundamentally different. Additionally, the opportunity to improve the elevation coverage interface oughtweighs the benefit we might gain by making it easy to port old ElevationModel code to TiledElevationCoverage.

Relates to #486
2018-04-27 13:45:02 -07:00
Zach Glueckert
b0e0e91be6 Add generic WCS Coverage object (#648)
* Update WcsCoverage object and add utility methods to coverage descriptions

* Remove redundant float parsing

* Change naming

* Cleanup formatting

* Remove comment

* Remove coverage name to index map

* Remove unused imports

* Add parse to WcsCoverage object

* Refactor input checks

* Fix WcsCoverage object creation

* Add WebCoverageService unit tests

* Update Sector matcher function name

* Change variable name for WebCoverageService reference

* Refactor Sector unit test for equality
2018-04-27 09:33:14 -07:00
Zach Glueckert
df8f0ed5b2 Update WCS tests and fix parsing errors (#643)
* Update WCS test resources to use same service

* Fix OwsKeyword element name check

* Fix DCPType element parsing

* Format WCS test resources
2018-04-26 09:38:08 -07:00
Zach Glueckert
2e8a9a7feb Update WcsDescribeCoverage to WcsCoverageDescriptions to match XML structure (#642)
* Change WcsDescribeCoverage to WcsCoverageDescriptions to match XML

* Modify WcsCoverage constructor to simplify interface
2018-04-24 18:33:22 -07:00
David Collins
8dc4861dc7 Enhanced the accuracy of ElevationModel's min/max elevations (#638)
- Corrected minElevation and maxElevation to return zero when the model has no coverages, or when all coverages are disabled
- Updated minAndMaxElevationsForSector to consult only the necessary coverages for a given sector
- Updated ElevationModel's unit tests to account for changes in the minAndMaxElevationsForSector interface and behavior
- Relates to epic #575
2018-04-20 14:44:46 -05:00
Mark Peterson
20973fe978 Initial elevation coverage composition (#580)
The first iteration of changes required to move toward fulfilling the requirements of issue #422.
2018-04-05 14:35:44 -07:00
Zach Glueckert
339b0faac4 Add WCS GetCapabilities and DescribeCoverage parsers (#581)
* Add initial WCS Capabilities parsing

* Add initial unit test

* Additional unit tests

* Add support for WCS 2.0.1 service metadata

* Add WCS 1.0.0 service parsing

* Add WCS 1.0.0 capability object model

* Convert instance based parsers to class based

* Clean up formatting and documentation

* Add initial WCS Describe Coverage object model and parser

* Add initial WCS Describe Coverage parsing and unit tests

* Fix childNodes property name

* Add WCS 2.0.1 DescribeCoverage domainSet

* Fix DomainSet parsing error

* Add offsetVector element parsing to WCS Describe Coverage domainSet

* Add boundedBy parsing to WCS Describe Coverage

* Add WCS 2.0.1 DescribeCoverage service parameter parsing

* Add reference to rangeType document element

* Add WCS 1.0.0 keywords

* Add WCS 1.0.0 lonLatEnvelope parsing

* Add WCS 1.0.0 DescribeCoverage supported CRSes parsing

* Add WCS 1.0.0 DescribeCoverage supported formats

* Add WCS 1.0.0 DescribeCoverage supported interpolations

* Add WCS 1.0.0 Describe Coverage domainSet

* Add basic WCS 1.0.0 DescribeCoverage RangeSet parsing

* Change all functions to prototype methods

* Move WMTS OWS files to OWS directory

* Remove duplicate OGC OWS files

* Fix profile property name

* Organize unit tests

* Fix formatting

* Organize unit tests and fix formatting

* Change assemby functions to instance methods

* Switch to parseFloat

* Reorganize code and update comments

* Update test formatting

* Add logging message

* Change properties to be representative of the document element names

* Change functions to instance methods

* Refactor element parsing structure

* Add trailing line return

* Move method version indication to the end of the name

* Simplify exception logging statements

* Update documentation

* Register WcsCapabilities and WcsDescribeCoverage with the WorldWind object
2018-03-28 11:15:27 -07:00
David Collins
9e89c14dee Modified BoundingBox.setToSector to handle large sectors (#548)
* Modified BoundingBox.setToSector to handle large sectors
- Sectors with a longitude span greater than 180 degrees are correctly represented
- Closes #545

* Repaired BoundingBox unit test
2018-03-15 15:50:43 -07:00
David Collins
ff17cc166c
Repaired unit tests erroneously modifying Vec3.ZERO (#547) 2018-03-15 15:31:21 -07:00
Zach Glueckert
1e48c0a904 Add GeoTiff parsing to ElevationModel and WcsEarthElevationModel (#493)
* Add WCS GeoTiff elevation support

* Fix parameter documentation

* Revert addition of read from array method

* Add capability to construct GeoTiffReader from URL or ArrayBuffer
- Modifies ElevationModel data retrieval handling for GeoTiffs

* Revise GeoTiffReader API
- Constructor takes ArrayBuffer and parses
- Provides synchronous image a data retrieval
- Add utility method with asynchronous XML HTTP Request

* Clean up variable naming, formatting, and other conventions

* Update naming and refactor callback to match library convention

* Remove old comments

* Fix one property accessor

* Provide full xhr object on failure and success callbacks

* Add grayscale and rgb retrieval unit tests

* Add logging message
2018-03-14 10:23:14 -07:00
Miguel Del Castillo
8a84f250bd Refactored ScreenCreditsController to use existing components (#499)
* Corrected comparison operators with type coercion

* Corrected comparison operator with type coercion

* Corrected comparison operator with type coercion

* Corrected comparison operators with type coercion

* First draft of ScreenCreditController composite

* Usage of ScreenText and ScreenImage in controller
 - Temporarily modified OSM layer server for testing purposes

* Attempted to render ScreenText and ScreenImage

* Corrected proper check of existence of both stringCredits and imageCredits

* ImageCredit offset test

* ImageCredit offset test (still no proper units implemented)

* Image credits correct offset implemented

* Removed unneeded attributes and methods related to opacity
 - Opacity will be handled in the Layer level. No need for the
   attribute in the class.
 - Due to the aforementioned, the text attributes won't need a
   default alpha setting either.
 - Removed transform matrices since the class is not handling graphics
   rendering anymore.

* First attempt at drawing string credits with proper offset

* Screencreditcontroller added as a layer

* Fix broken unit tests

* Change ScreenCreditController so it will operate as a Layer
 - Identified which part of TextRenderer is causing the ScreenText
   not to render.

* doRender override in ScreenCreditController so it works as before
 - Corrected typo in TextRenderer

* Solved bug for string credits.
 - An object was being passed instead of a string
 - Bug: Offset calculation is still wrong, but text is rendering now
 - Bug: First ScreenText is rendered without transparency, the second one
   is half transparent.
 - Bug: ScreenTexts are rendering with outlines

* Rendered all image and string credits in their appropriate offsets
 - Layer opacity is still not accounted for
 - Bug: "WorldWindow.drawOrderedRenderables: Error while rendering
   an ordered renderable. Cannot read property 'opacity' of null"
   E.g: USGSSlabs is not rendering the slabs.

* Set default layer opacity to fully replicate prior behavior
 - Bug regarding other orderedRenderables opacity still present.

* New controller proposal

* Obtainint textures with makeOrderedRenderable(). Still getting bugs.

* Removed layer opacity and unneeded return statement

* Added fixed credit spacing. Reintroduced default layer opacity

* Removed previous offsetting code

* Temporary modification to WorldWindow to work around bug (issue 494)

* Credit display with fixed spacing

* Aligning to right text credits without resorting to texture size

* Added TextAttributes.offset setting for text credits

* Added previously existing exception handling

* Simplified loop indexes

* Changed credit spacing index placement to increase readability

* Added note to document temporary workaround

* Reverted change to comparison operators
 - Will submit these changes in a different branch.

* Reverted change to comparison operators
 - Will submit these changes in a different branch.

* Removed currently unused modules. Reintroduced license notice.

* Removed now unused property

* Renamed index to a more descriptive name

* Used faster pattern in iterative loop

* First attempt to switch RenderableLayer inheritance to Layer

* Added call to render() to every renderable, removed call to Layer.doRender()
 - Removed all unused modules

* Modified whitespace to license as in other modules

* Removed unused parameter

* Corrected another unneeded iterated call to Array.length
 - Properly nitialized index in iterator

* Verify previously added credit existence to avoid credit repetition

* Code formatting corrections
2018-03-07 09:31:35 -08:00
AkeluX
55254853d9 Update copyright year 2018-02-22 18:18:15 +01:00
jbalhar
314a6aab86 Merge branch 'develop' into feature/kmz-embedded-resources 2018-02-21 08:36:44 +01:00
Zach Glueckert
03ffcc7393 Update CSS Color String calculation and use (#474)
* Add deprecation warning to toHexString

* Correct CSS color string generation and rename method
- Switch to `round` operation for float to 16 bit conversion

* Update comments

* Update method name

* Add CSS Color String generation unit test

* Add CSS color string conversion unit test and format files

* Add CSS color string conversion unit test and format files

* Fix Color unit tests

* Add CSS color string conversion test

* Switch to colorFromBytes function and fix precision error
2018-02-20 13:33:23 -08:00
Miguel Del Castillo
ee60729668 Addition of text outline color customization features (#452)
* Modified texture modulation to always modulate to white
 - Corrected wrong logger message call in TextRenderer
 - Corrected missing semicolon in TextRenderer
 - Corrected missing color string in state key of TextAttributes

* Modified documentation to reflect how color is now applied to the text

* Removed parameters from TextRenderer functions that are now unneeded
 - Removed getMaxLineHeight function.
 - Updated call of textRenderer.wrap in Annotation.

* Returned getMaxLineHeight function for documentation purposes

* Modified TextRenderer unit test to fit new function parameters

* First draft of DrawContext.renderText
 - Counterpart to WWA's RenderContext.renderText.

* First propagation of textAttributes to Text through DrawContext
 - Bug: ScreenText and Annotations examples show their text in
   incorrect colors.

* Modified Annotation to use new DrawContext.renderText
 - Annotations example updated to explicitly remove outline from
   the annotation's text.
 - Temporary outline settings for dc.textRenderer are now unneeded and
   are removed as well.

* Corrected Annotation's configuration of fragment program color

* Modified Placemark to use new DrawContext.renderText function

* Corrected wrong assignation of outlineColor

* Updated DrawContext.renderText and TextRenderer documentation

* Disabled Annotation's text outline by default in its constructor
 - Removed superfluous change in TextRenderer documentation
 - Removed text outline disable in Annotations example

* Changed default TextAttributes to a more appropriate name

* Refactored AnnotationAttributes' default text fields for readability
2018-02-06 09:46:05 -08:00
David Collins
1fd850715b
Minor LookAtNavigator cleanup (#449)
- Moved LookAtNavigator properties used exclusively for gesture response from LookAtNavigator to BasicWorldWindowController.
- Adjusted unit tests to accommodate LookAtNavigator properties moved to BasicWorldWindowController.
- Relates to #279
2018-01-16 19:56:17 -08:00
Mark Peterson
59c04fb1b5 Refactor NavigatorState (#444)
* Work in progress

* Further controller refactoring

* Bug fixes

* Added docs and removed test code

* Removed commented out code

* Revert WebStorm config changes

* Formatting tweaks

* Doc fixes

* Navigator state phase 1

* unProject refactor and unit tests

* Fix for incorrect matrix

* Moved convertToViewport

* Moved further NavigatorState methods, added unit tests

* Remove experimental change

* Various property migrations

* Final property moves

* Bug fixes

* Unit test update

* Unit test corrections

* Unit test cleanup

* Unit test fixes

* Unit test fixes

* Formatting fixes

* Documentation tweaks

* Move calls that require access to wwd.drawContext

* Remove wwd.drawContext dependencies

* Remove drawContext dependencies

* Fixes for classes saving direct references to drawcontext properties.

* Formatting fixes

* WIP

* Fix for 2D panning issue

* Removed commented out code
2018-01-16 10:37:35 -08:00
David Collins
7245ba35f1 Added missing semicolon in TextRenderer.test.js 2018-01-12 14:55:12 -08:00
Miguel Del Castillo
9ee36f61e7 Modified RenderText test for empty string input
- Added unit test regarding the aforementioned.
2018-01-10 13:55:31 -06:00
Miguel Del Castillo
cfa9a9dffb Modified mocked DrawContext name to reflect that it's a mockup 2018-01-09 16:29:51 -06:00
Miguel Del Castillo
9d566761d8 Modified TextRenderer unit test to align it with new constructor
- Included a mock DrawContext to avoid WebGL context requirements.
 - Added a new test of exception throwing for the constructor.
2018-01-09 16:23:17 -06:00
Miguel Del Castillo
c4073f0228 Corrected extra parameter in wrapLine call
- Made width a constant in wrap calls.
2018-01-05 15:56:38 -06:00
Miguel Del Castillo
7bf6635131 Dummy commit to trigger reload of a failed TravisCI job 2018-01-05 14:54:49 -06:00
Miguel Del Castillo
639664bc70 Modified mock textSize function to return a realistic value 2018-01-05 13:10:22 -06:00
Miguel Del Castillo
82239849a1 Added comment to TextRenderer mockup 2018-01-05 11:23:16 -06:00
Miguel Del Castillo
7c021ef932 Added tests for wrap and wrapLine functions 2018-01-05 11:16:24 -06:00
Miguel Del Castillo
87df81ea51 First draft of TextRenderer unit test 2018-01-03 17:48:13 -06:00
jbalhar
f36c379769 Merge branch 'develop' into feature/kmz-embedded-resources 2018-01-03 13:42:34 +01:00
Patrick Hogan
6ebc542db8 Updated. 2017-11-20 14:06:30 -08:00