Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCellPolarity.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
27#ifndef _SOURCE_MODELS_CENTER_TFCELLPOLARITY_H_
28#define _SOURCE_MODELS_CENTER_TFCELLPOLARITY_H_
29
30#include <tfParticle.h>
31#include <tfAngle.h>
32#include <tfBond.h>
33#include <tfForce.h>
34#include <tfParticleTypeList.h>
35#include <tfPotential.h>
36#include <rendering/tfArrowRenderer.h>
37
38#include <string>
39#include <unordered_map>
40
41namespace TissueForge::models::center::CellPolarity {
42
50CPPAPI_FUNC(FVector3) getVectorAB(const int &pId, const bool &current=true);
51
59CPPAPI_FUNC(FVector3) getVectorPCP(const int &pId, const bool &current=true);
60
69CPPAPI_FUNC(void) setVectorAB(const int &pId, const FVector3 &pVec, const bool &current=true, const bool &init=false);
70
79CPPAPI_FUNC(void) setVectorPCP(const int &pId, const FVector3 &pVec, const bool &current=true, const bool &init=false);
80
85CPPAPI_FUNC(void) update();
86
96CPPAPI_FUNC(void) registerParticle(ParticleHandle *ph);
97
105CPPAPI_FUNC(void) unregister(ParticleHandle *ph);
106
117CPPAPI_FUNC(void) registerType(
118 ParticleType *pType,
119 const std::string &initMode="random",
120 const FVector3 &initPolarAB=FVector3(0.0),
121 const FVector3 &initPolarPCP=FVector3(0.0)
122);
123
130CPPAPI_FUNC(const std::string) getInitMode(ParticleType *pType);
131
138CPPAPI_FUNC(void) setInitMode(ParticleType *pType, const std::string &value);
139
146CPPAPI_FUNC(const FVector3) getInitPolarAB(ParticleType *pType);
147
154CPPAPI_FUNC(void) setInitPolarAB(ParticleType *pType, const FVector3 &value);
155
162CPPAPI_FUNC(const FVector3) getInitPolarPCP(ParticleType *pType);
163
170CPPAPI_FUNC(void) setInitPolarPCP(ParticleType *pType, const FVector3 &value);
171
176struct CAPI_EXPORT PersistentForce : Force {
178 FloatP_t sensAB = 0.0;
179
181 FloatP_t sensPCP = 0.0;
182
184};
185
193CPPAPI_FUNC(PersistentForce*) createPersistentForce(const FloatP_t &sensAB=0.0, const FloatP_t &sensPCP=0.0);
194
195typedef enum PolarContactType {
196 REGULAR = 0,
197 ISOTROPIC = 1,
198 ANISOTROPIC = 2
199} PolarContactType;
200
202 FloatP_t arrowLength = 1.0;
203};
204
210CPPAPI_FUNC(void) setDrawVectors(const bool &_draw);
211
220CPPAPI_FUNC(void) setArrowColors(const std::string &colorAB, const std::string &colorPCP);
221
229CPPAPI_FUNC(void) setArrowScale(const FloatP_t &_scale);
230
238CPPAPI_FUNC(void) setArrowLength(const FloatP_t &_length);
239
246CPPAPI_FUNC(PolarityArrowData*) getVectorArrowAB(const int32_t &pId);
247
254CPPAPI_FUNC(PolarityArrowData*) getVectorArrowPCP(const int32_t &pId);
255
261CPPAPI_FUNC(void) load();
262
267struct CAPI_EXPORT ContactPotential : Potential {
269 FloatP_t couplingFlat;
270
273
276
279
281 PolarContactType cType;
282
284 FloatP_t mag;
285
287 FloatP_t rate;
288
290 FloatP_t bendingCoeff;
291
293};
294
310 const FloatP_t &cutoff,
311 const FloatP_t &mag=1.0,
312 const FloatP_t &rate=1.0,
313 const FloatP_t &distanceCoeff=1.0,
314 const FloatP_t &couplingFlat=1.0,
315 const FloatP_t &couplingOrtho=0.0,
316 const FloatP_t &couplingLateral=0.0,
317 std::string contactType="regular",
318 const FloatP_t &bendingCoeff=0.0
319);
320
321};
322
323
324#endif // _SOURCE_MODELS_CENTER_TFCELLPOLARITY_H_
HRESULT init(const std::vector< std::string > &argv)
Force is a metatype, in that Tissue Forge has lots of different instances of force functions,...
Definition tfForce.h:69
A handle to a particle.
Definition tfParticle.h:313
Structure containing information on each particle type.
Definition tfParticle.h:768
A Potential object is a compiled interpolation of a given function. The Universe applies potentials t...
Definition tfPotential.h:213
Defines polarity state dynamics and anisotropic adhesion.
Definition tfCellPolarity.h:267
FloatP_t couplingFlat
Definition tfCellPolarity.h:269
FloatP_t bendingCoeff
Definition tfCellPolarity.h:290
FloatP_t mag
Definition tfCellPolarity.h:284
FloatP_t rate
Definition tfCellPolarity.h:287
FloatP_t couplingOrtho
Definition tfCellPolarity.h:272
FloatP_t distanceCoeff
Definition tfCellPolarity.h:278
FloatP_t couplingLateral
Definition tfCellPolarity.h:275
PolarContactType cType
Definition tfCellPolarity.h:281
Defines a force due to polarity state.
Definition tfCellPolarity.h:176
Vector visualization specification.
Definition tfArrowRenderer.h:46
void setVectorAB(const int &pId, const FVector3 &pVec, const bool &current=true, const bool &init=false)
Sets the AB polarity vector of a cell.
void update()
Updates all running polarity models.
PolarityArrowData * getVectorArrowPCP(const int32_t &pId)
Gets the rendering info for the PCP polarity vector of a cell.
void registerType(ParticleType *pType, const std::string &initMode="random", const FVector3 &initPolarAB=FVector3(0.0), const FVector3 &initPolarPCP=FVector3(0.0))
Registers a particle type as polar.
FVector3 getVectorPCP(const int &pId, const bool &current=true)
Gets the PCP polarity vector of a cell.
void setVectorPCP(const int &pId, const FVector3 &pVec, const bool &current=true, const bool &init=false)
Sets the PCP polarity vector of a cell.
const FVector3 getInitPolarPCP(ParticleType *pType)
Gets the initial PCP polar vector of a type.
void setDrawVectors(const bool &_draw)
Toggles whether polarity vectors are rendered.
void unregister(ParticleHandle *ph)
Unregisters a particle as polar.
PolarityArrowData * getVectorArrowAB(const int32_t &pId)
Gets the rendering info for the AB polarity vector of a cell.
void setInitPolarAB(ParticleType *pType, const FVector3 &value)
Sets the initial AB polar vector of a type.
void setInitMode(ParticleType *pType, const std::string &value)
Sets the name of the initialization mode of a type.
void setArrowScale(const FloatP_t &_scale)
Sets scale of rendered polarity vectors.
PersistentForce * createPersistentForce(const FloatP_t &sensAB=0.0, const FloatP_t &sensPCP=0.0)
Creates a persistent polarity force.
void load()
Runs the polarity model along with a simulation. Must be called before doing any operations with this...
void setArrowColors(const std::string &colorAB, const std::string &colorPCP)
Sets rendered polarity vector colors.
ContactPotential * createContactPotential(const FloatP_t &cutoff, const FloatP_t &mag=1.0, const FloatP_t &rate=1.0, const FloatP_t &distanceCoeff=1.0, const FloatP_t &couplingFlat=1.0, const FloatP_t &couplingOrtho=0.0, const FloatP_t &couplingLateral=0.0, std::string contactType="regular", const FloatP_t &bendingCoeff=0.0)
Creates a contact-mediated polarity potential.
void registerParticle(ParticleHandle *ph)
Registers a particle as polar.
FVector3 getVectorAB(const int &pId, const bool &current=true)
Gets the AB polarity vector of a cell.
void setInitPolarPCP(ParticleType *pType, const FVector3 &value)
Sets the initial PCP polar vector of a type.
const std::string getInitMode(ParticleType *pType)
Gets the name of the initialization mode of a type.
const FVector3 getInitPolarAB(ParticleType *pType)
Gets the initial AB polar vector of a type.
void setArrowLength(const FloatP_t &_length)
Sets length of rendered polarity vectors.