Commit e4db0984 authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

Merge branch 'FixUncrustify' into 'master'

Fix uncrustify bug that mistakenly remove proper semicolons

See merge request !345
parents 137d2d48 8f747276
Pipeline #141335 passed with stage
in 0 seconds
......@@ -36,13 +36,13 @@ RenderParticleEmitter::RenderParticleEmitter(std::shared_ptr<Geometry> geometr
RenderParticleKeyFrame startFrame;
startFrame.m_color = Color::White;
startFrame.m_time = 0.0f;
startFrame.m_time = 0.0f;
startFrame.m_acceleration = Vec3f(0, 0, 0);
startFrame.m_rotationalAcceleration = 0.0f;
RenderParticleKeyFrame endFrame;
endFrame.m_color = startFrame.m_color;
endFrame.m_time = m_time;
endFrame.m_time = m_time;
endFrame.m_acceleration = Vec3f(0, 0, 0);
endFrame.m_rotationalAcceleration = 0.0f;
......
......@@ -41,7 +41,7 @@ namespace imstk
///
struct RenderParticleKeyFrame
{
float m_time = 0;
float m_time = 0;
Color m_color = Color::White;
Vec3f m_acceleration = Vec3f(0, 0, 0);
float m_rotationalAcceleration = 0;
......
......@@ -55,7 +55,7 @@ public:
///
/// \brief Constructor
///
StopWatch() {}
StopWatch() {};
///
/// \brief Destructor
......@@ -125,7 +125,7 @@ public:
///
/// \brief Constructor
///
CpuTimer() : StopWatch() {}
CpuTimer() : StopWatch() {};
///
/// \brief Destructor
......@@ -135,7 +135,7 @@ public:
///
/// \brief Start the appropriate timer
///
virtual void start() override { cpuTimeKeeper = std::clock(); }
virtual void start() override { cpuTimeKeeper = std::clock(); };
///
/// \brief Returns the CPU time elapsed since calling start
......
......@@ -51,7 +51,7 @@ protected:
{
m_buttons[i] = false;
}
}
};
void run() = delete;
void cleanUp() = delete;
......@@ -60,17 +60,17 @@ public:
///
/// \brief Set position
///
void setPosition(const Vec3d& pos) { m_position = pos; }
void setPosition(const Vec3d& pos) { m_position = pos; };
///
/// \brief Set velocity
///
void setVelocity(const Vec3d& vel) { m_velocity = vel; }
void setVelocity(const Vec3d& vel) { m_velocity = vel; };
///
/// \brief Set orientation
///
void setOrientation(const Quatd& orient) { m_orientation = orient; }
void setOrientation(const Quatd& orient) { m_orientation = orient; };
///
/// \brief Set orientation from 4x4 transform
......@@ -78,7 +78,7 @@ public:
void setOrientation(double* transform)
{
m_orientation = (Eigen::Affine3d(Eigen::Matrix4d(transform))).rotation();
}
};
///
/// \brief Set the button status if it exists
......
......@@ -33,7 +33,7 @@ namespace imstk
void
HDAPIDeviceClient::init()
{
m_buttons = std::map<size_t, bool>{ { 0, false }, { 1, false }, { 2, false }, { 3, false } }
m_buttons = std::map<size_t, bool>{ { 0, false }, { 1, false }, { 2, false }, { 3, false } };
//flush error stack
HDErrorInfo errorFlush;
......
......@@ -35,7 +35,7 @@ ForceModelConfig::ForceModelConfig(const std::string& configFileName) : m_loadSu
{
this->parseConfig(configFileName);
}
}
};
bool
ForceModelConfig::parseConfig(const std::string& configFileName)
......
......@@ -42,7 +42,7 @@ public:
///
/// \brief Constructor
///
InternalForceModel() {}
InternalForceModel() {};
///
/// \brief Destructor
......
......@@ -66,7 +66,7 @@ public:
double* zero = (double*)calloc(m_stiffnessMatrix->GetNumRows(), sizeof(double));
stVKStiffnessMatrix->ComputeStiffnessMatrix(zero, m_stiffnessMatrix.get());
free(zero);
}
};
///
/// \brief Destructor
......@@ -77,7 +77,7 @@ public:
{
delete m_stiffnessMatrixRawPtr;
}
}
};
///
/// \brief Get the internal force
......
......@@ -609,35 +609,33 @@ NonLinearSystem::VectorFunctionType
FEMDeformableBodyModel::getFunction()
{
// Function to evaluate the nonlinear objective function given the current state
const auto func = [&, this](const Vectord& q, const bool semiImplicit) -> const Vectord&
{
(semiImplicit) ?
this->computeSemiImplicitSystemRHS(*m_previousState.get(), *m_currentState.get(), m_updateType) :
this->computeImplicitSystemRHS(*m_previousState.get(), *m_currentState.get(), m_updateType);
if (this->m_implementFixedBC)
{
applyBoundaryConditions(m_Feff);
}
return m_Feff;
};
return func;
return [&, this](const Vectord &q, const bool semiImplicit)->const Vectord &
{
(semiImplicit) ?
this->computeSemiImplicitSystemRHS(*m_previousState.get(), *m_currentState.get(), m_updateType) :
this->computeImplicitSystemRHS(*m_previousState.get(), *m_currentState.get(), m_updateType);
if (this->m_implementFixedBC)
{
applyBoundaryConditions(m_Feff);
}
return m_Feff;
};
}
NonLinearSystem::MatrixFunctionType
FEMDeformableBodyModel::getFunctionGradient()
{
// Gradient of the nonlinear objective function given the current state
const auto func = [&, this](const Vectord& q) -> const SparseMatrixd&
{
this->computeImplicitSystemLHS(*m_previousState.get(), *m_currentState.get(), m_updateType);
return [&, this](const Vectord &q)->const SparseMatrixd &
{
this->computeImplicitSystemLHS(*m_previousState.get(), *m_currentState.get(), m_updateType);
if (this->m_implementFixedBC)
{
applyBoundaryConditions(m_Keff);
}
return m_Keff;
};
return func;
if (this->m_implementFixedBC)
{
applyBoundaryConditions(m_Keff);
}
return m_Keff;
};
}
NonLinearSystem::UpdateFunctionType
......@@ -696,4 +694,4 @@ FEMDeformableBodyModel::setFixedSizeTimeStepping()
m_timeStepSizeType = TimeSteppingType::fixed;
m_timeIntegrator->setTimestepSizeToDefault();
}
} // imstk
} // imstk
\ No newline at end of file
......@@ -235,12 +235,12 @@ public:
///
/// \brief Set the time step size
///
virtual void setTimeStep(const double timeStep) { m_timeIntegrator->setTimestepSize(timeStep); }
virtual void setTimeStep(const double timeStep) { m_timeIntegrator->setTimestepSize(timeStep); };
///
/// \brief Returns the time step size
///
virtual double getTimeStep() const { return m_timeIntegrator->getTimestepSize(); }
virtual double getTimeStep() const { return m_timeIntegrator->getTimestepSize(); };
///
/// \brief Set the time step size to fixed size
......@@ -250,9 +250,9 @@ public:
///
/// \brief Set the fixed BC implementation state
///
void enableFixedBC() { m_implementFixedBC = true; }
void disableFixedBC() { m_implementFixedBC = false; }
bool isFixedBCImplemented() const { return m_implementFixedBC; }
void enableFixedBC() { m_implementFixedBC = true; };
void disableFixedBC() { m_implementFixedBC = false; };
bool isFixedBCImplemented() const { return m_implementFixedBC; };
protected:
std::shared_ptr<InternalForceModel> m_internalForceModel; ///> Mathematical model for intenal forces
......
......@@ -33,7 +33,7 @@ VectorizedState::initialize(const size_t numDof)
m_q.setZero();
m_qDot.setZero();
m_qDotDot.setZero();
}
};
void
VectorizedState::setState(const Vectord& u, const Vectord& v, const Vectord& a)
......
......@@ -46,7 +46,7 @@ public:
///
/// \brief Protected constructor
///
Canvas() {}
Canvas() {};
///
/// \brief Destructor
......
......@@ -50,7 +50,7 @@ public:
///
/// \brief Returns the volume of the cube
///
double getVolume() const override { return 0; }
double getVolume() const override { return 0; };
protected:
friend class VulkanDecalRenderDelegate;
......@@ -58,10 +58,10 @@ protected:
std::deque<std::shared_ptr<Decal>> m_orderedDecals;
std::deque<std::shared_ptr<Decal>> m_freeDecals;
void applyTranslation(const Vec3d t) override {}
void applyRotation(const Mat3d r) override {}
void applyScaling(const double s) override {}
virtual void updatePostTransformData() override {}
void applyTranslation(const Vec3d t) override {};
void applyRotation(const Mat3d r) override {};
void applyScaling(const double s) override {};
virtual void updatePostTransformData() override {};
unsigned int m_maxNumDecals;
unsigned int m_numDecals = 0;
......
......@@ -72,7 +72,7 @@ public:
inline bool isValid() const override
{
return true;
}
};
///
/// \brief Set the transform
......
......@@ -64,7 +64,7 @@ public:
///
/// \brief Returns the volume of the geometry (if valid)
///
virtual double getVolume() const { return 0; }
virtual double getVolume() const { return 0; };
///
/// \brief Compute the bounding box for the entire mesh
......@@ -158,7 +158,7 @@ public:
/// \brief Set the topologyChanged flag
///
void setTopologyChangedFlag(const bool flag) { m_topologyChanged = flag; }
bool getTopologyChangedFlag() const { return m_topologyChanged; }
bool getTopologyChangedFlag() const { return m_topologyChanged; };
///
/// \brief Set load factor
......
......@@ -107,7 +107,7 @@ public:
/// \brief Get volume
/// As these are particles, the volume is 0
///
double getVolume() const override { return 0; }
double getVolume() const override { return 0; };
protected:
friend class VulkanParticleRenderDelegate;
......@@ -125,9 +125,9 @@ protected:
unsigned int m_numParticles = 0;
void applyTranslation(const Vec3d t) override {}
void applyRotation(const Mat3d r) override {}
void applyScaling(const double s) override {}
virtual void updatePostTransformData() override {}
void applyTranslation(const Vec3d t) override {};
void applyRotation(const Mat3d r) override {};
void applyScaling(const double s) override {};
virtual void updatePostTransformData() override {};
};
}
......@@ -76,7 +76,7 @@ public:
///
/// \brief Let the polydata mapper know if it is for the surface mesh
///
void setIsSurfaceMapper(const bool val) { m_isSurfaceMapper = val; }
void setIsSurfaceMapper(const bool val) { m_isSurfaceMapper = val; };
protected:
///
......
......@@ -69,7 +69,7 @@ public:
/// in that memory is directly mapped from the VisualModel to the
/// RenderDelegate.
///
virtual void update(const uint32_t frameIndex) {}
virtual void update(const uint32_t frameIndex) {};
///
/// \brief Get vertex buffer
......@@ -105,7 +105,7 @@ protected:
///
/// \brief Default constructor (protected)
///
VulkanRenderDelegate() {}
VulkanRenderDelegate() {};
std::shared_ptr<VulkanVertexBuffer> m_vertexBuffer;
......
......@@ -40,7 +40,7 @@ public:
///
/// \brief Binds the buffer to memory
///
virtual void bind() {}
virtual void bind() {};
protected:
uint32_t m_buffering = 1;
......
......@@ -61,7 +61,7 @@ public:
void initializeFramebuffer(VkRenderPass* renderPass);
~VulkanFramebuffer() {}
~VulkanFramebuffer() {};
void changeImageLayout(VkCommandBuffer& commandBuffer,
VkImage& image,
......
......@@ -152,8 +152,8 @@ VulkanMaterialDelegate::buildMaterial(VulkanRenderer* renderer)
&& !m_material->isLineMesh()
&& !m_depthPrePass
&& !m_material->isParticle();
m_constants.diffuseTexture = (m_material->getTexture(Texture::Type::DIFFUSE)->getPath() != "") && !m_depthOnlyPass;
m_constants.normalTexture = (m_material->getTexture(Texture::Type::NORMAL)->getPath() != "") && !m_depthOnlyPass;
m_constants.diffuseTexture = (m_material->getTexture(Texture::Type::DIFFUSE)->getPath() != "") && !m_depthOnlyPass;
m_constants.normalTexture = (m_material->getTexture(Texture::Type::NORMAL)->getPath() != "") && !m_depthOnlyPass;
m_constants.roughnessTexture = (m_material->getTexture(Texture::Type::ROUGHNESS)->getPath() != "") && !m_depthOnlyPass;
m_constants.metalnessTexture = (m_material->getTexture(Texture::Type::METALNESS)->getPath() != "") && !m_depthOnlyPass;
m_constants.ambientOcclusionTexture = (m_material->getTexture(Texture::Type::AMBIENT_OCCLUSION)->getPath() != "") && !m_depthOnlyPass;
......@@ -936,7 +936,7 @@ VulkanMaterialDelegate::createDescriptorSets(VulkanRenderer* renderer)
// Global buffers
std::vector<VkDescriptorBufferInfo> fragmentBufferInfo(2);
fragmentBufferInfo[0].offset = renderer->m_globalFragmentUniformBuffer->getUniformBuffer()->getOffset();
fragmentBufferInfo[0].offset = renderer->m_globalFragmentUniformBuffer->getUniformBuffer()->getOffset();;
fragmentBufferInfo[0].range = renderer->m_globalFragmentUniformBuffer->getUniformBuffer()->getSize();
fragmentBufferInfo[0].buffer = *(renderer->m_globalFragmentUniformBuffer->getUniformBuffer()->getBuffer());
......
......@@ -250,4 +250,4 @@ VulkanMemoryManager::getAlignedSize(VkDeviceSize size, VkDeviceSize alignment)
return newSize;
}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -96,4 +96,4 @@ protected:
std::vector<VulkanInternalBufferGroup*> m_buffers;
std::vector<VulkanInternalImage*> m_images;
};
}
};
......@@ -560,16 +560,16 @@ VulkanRenderer::initializeFramebufferImages(VkSwapchainKHR* swapchain)
}
VkSamplerCreateInfo samplerInfo;
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
samplerInfo.flags = 0;
samplerInfo.magFilter = VK_FILTER_LINEAR;
samplerInfo.minFilter = VK_FILTER_LINEAR;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; // Trilinear interpolation
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
samplerInfo.flags = 0;
samplerInfo.magFilter = VK_FILTER_LINEAR;
samplerInfo.minFilter = VK_FILTER_LINEAR;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; // Trilinear interpolation
samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
samplerInfo.mipLodBias = 0.0;
samplerInfo.mipLodBias = 0.0;
samplerInfo.anisotropyEnable = VK_FALSE;
samplerInfo.maxAnisotropy = 1.0;
samplerInfo.compareEnable = VK_FALSE;
......@@ -646,16 +646,16 @@ VulkanRenderer::initializeFramebuffers(VkSwapchainKHR* swapchain)
{
VkSamplerCreateInfo samplerInfo;
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
samplerInfo.flags = 0;
samplerInfo.magFilter = VK_FILTER_LINEAR;
samplerInfo.minFilter = VK_FILTER_LINEAR;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; // Trilinear interpolation
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
samplerInfo.flags = 0;
samplerInfo.magFilter = VK_FILTER_LINEAR;
samplerInfo.minFilter = VK_FILTER_LINEAR;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; // Trilinear interpolation
samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.mipLodBias = 0.0;
samplerInfo.mipLodBias = 0.0;
samplerInfo.anisotropyEnable = VK_FALSE; // TODO:: add option to enable
samplerInfo.maxAnisotropy = 1.0;
samplerInfo.compareEnable = VK_FALSE;
......
......@@ -178,7 +178,7 @@ protected:
/// \brief Update background colors
///
void updateBackground(const Vec3d color1, const Vec3d color2 = Vec3d::Zero(), const bool gradientBackground = false) {}
void updateBackground(const Vec3d color1, const Vec3d color2 = Vec3d::Zero(), const bool gradientBackground = false) {};
protected:
friend class VulkanViewer;
......
......@@ -93,7 +93,7 @@ public:
{
m_image = new VkImage();
}
}
};
VkImage* getImage()
{
......@@ -130,7 +130,7 @@ public:
{
m_type = type;
m_buffer = new VkBuffer();
}
};
VkBuffer* getBuffer()
{
......@@ -158,7 +158,7 @@ public:
VulkanInternalBuffer(VulkanInternalBufferGroup* bufferGroup)
{
m_bufferGroup = bufferGroup;
}
};
VkBuffer* getBuffer()
{
......
......@@ -67,11 +67,11 @@ VulkanTextureDelegate::VulkanTextureDelegate(
m_imageOffsetAlignment = this->getStride(m_format);
m_imageInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
m_imageInfo.pNext = nullptr;
m_imageInfo.format = m_format;
m_imageInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
m_imageInfo.pNext = nullptr;
m_imageInfo.format = m_format;
m_imageInfo.imageType = VK_IMAGE_TYPE_2D;
m_imageInfo.extent = { m_width, m_height, 1 };
m_imageInfo.extent = { m_width, m_height, 1 };
m_imageInfo.mipLevels = m_mipLevels;
m_imageInfo.arrayLayers = m_arrayLayers;
m_imageInfo.samples = VK_SAMPLE_COUNT_1_BIT;
......@@ -127,16 +127,16 @@ VulkanTextureDelegate::VulkanTextureDelegate(
vkCreateImageView(memoryManager.m_device, &imageViewInfo, nullptr, &m_imageView);
VkSamplerCreateInfo samplerInfo;
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
samplerInfo.flags = 0;
samplerInfo.magFilter = VK_FILTER_LINEAR;
samplerInfo.minFilter = VK_FILTER_LINEAR;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; // Trilinear interpolation
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
samplerInfo.flags = 0;
samplerInfo.magFilter = VK_FILTER_LINEAR;
samplerInfo.minFilter = VK_FILTER_LINEAR;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; // Trilinear interpolation
samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.mipLodBias = 0.0;
samplerInfo.mipLodBias = 0.0;
samplerInfo.anisotropyEnable = anisotropyAmount == 0.0f ? VK_FALSE : VK_TRUE; // TODO:: add option to enable
samplerInfo.maxAnisotropy = anisotropyAmount;
samplerInfo.compareEnable = VK_FALSE;
......@@ -310,7 +310,7 @@ VulkanTextureDelegate::uploadTexture(VulkanMemoryManager& memoryManager)
stagingBufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
stagingBufferInfo.pNext = nullptr;
stagingBufferInfo.flags = 0;
stagingBufferInfo.size = imageSize;
stagingBufferInfo.size = imageSize;
stagingBufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
stagingBufferInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
stagingBufferInfo.queueFamilyIndexCount = 0;
......@@ -465,7 +465,7 @@ VulkanTextureDelegate::uploadCubemapTexture(VulkanMemoryManager& memoryManager)
stagingBufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
stagingBufferInfo.pNext = nullptr;
stagingBufferInfo.flags = 0;
stagingBufferInfo.size = imageSize;
stagingBufferInfo.size = imageSize;
stagingBufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
stagingBufferInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
stagingBufferInfo.queueFamilyIndexCount = 0;
......
......@@ -32,7 +32,7 @@ VulkanUniformBuffer::VulkanUniformBuffer(VulkanMemoryManager& memoryManager, uin
uniformBufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
uniformBufferInfo.pNext = nullptr;
uniformBufferInfo.flags = 0;
uniformBufferInfo.size = uniformSize * memoryManager.m_buffering;
uniformBufferInfo.size = uniformSize * memoryManager.m_buffering;
uniformBufferInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
uniformBufferInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
uniformBufferInfo.queueFamilyIndexCount = 0;
......
......@@ -61,11 +61,11 @@ public:
{
LOG(FATAL) << "Unable to build vertex shader : " << filename;
}
}
};
uint32_t getShaderLength() { return (uint32_t)m_data->size(); }
uint32_t getShaderLength() { return (uint32_t)m_data->size(); };