Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes #90

Merged
merged 2 commits into from
Dec 15, 2016
Merged

Various fixes #90

merged 2 commits into from
Dec 15, 2016

Conversation

favreau
Copy link
Member

@favreau favreau commented Dec 14, 2016

  • Crash on braynsViewer resizing
  • Load/Save meshes with OSPRay plugin
  • Set default camera closer to 3D model

@@ -62,6 +62,9 @@ void BraynsViewer::_registerKeyboardShortcuts()
keyHandler.registerKeyboardShortcut(
'x', "Set timestamp to " + std::to_string( DEFAULT_TEST_TIMESTAMP ),
std::bind( &BraynsViewer::_defaultTimestamp, this ));
keyHandler.registerKeyboardShortcut(
'|', "Create cache file ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great key choice :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'^' and '%' were already used...


bool Scene::isEmpty() const
{
return ( _primitives.size() == 0 && _trianglesMeshes.size() == 0 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parentheses not needed; also empty() would look better here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Done.

@@ -99,15 +99,15 @@ bool MeshLoader::importMeshFromFile(
for(size_t i=0; i < mesh->mNumVertices; ++i )
{
aiVector3D v = mesh->mVertices[ i ];
const Vector3f vertex = { -v.x, v.y, -v.z };
const Vector3f vertex = { v.x, v.y, v.z };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, good fix!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Quite proud of this one I have to say ;-)

@@ -891,4 +891,9 @@ uint64_t OptiXScene::_getBvhSize( const uint64_t nbElements ) const
return 64 * 1.3f * nbElements;
}

void OptiXScene::saveSceneToCacheFile()
{
BRAYNS_ERROR << "OptiXScene::saveSceneToCacheFile not implemented" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, ideally the cache file would be engine agnostic, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it needs a different implementation for every engine. For the moment, only OSPRay support large models, and requires the use of a cache.

@@ -128,6 +128,29 @@ void OSPRayScene::_saveCacheFile()
file.write( ( char* )&nbMaterials, sizeof( size_t ));
BRAYNS_INFO << nbMaterials << " materials" << std::endl;

// Save materials
for( size_t materialId = 0; materialId < nbMaterials; ++materialId )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++11 range for over _materials won't work? Or nbMaterials != _materials.size()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remains from pre-C++11 implementation... Fixed.

{
return ( _primitives.size() == 0 && _trianglesMeshes.size() == 0 );
return _primitives.size() == 0 && _trianglesMeshes.size() == 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still not empty() here?

@favreau favreau merged commit 28e1921 into BlueBrain:master Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants